/* FUENTES */
@font-face {
  font-family: "Ethnocentric";
  src: url("Ethnocentric-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("JetBrainsMono-Medium.woff2") format("woff2");
}

:root {
  --bg-black: #000000;
  --card-dark: #0a0a0a;
  --accent-purple: #a855f7;
  --neon-cyan: #00ffcc;
  --text-dim: #888;
  --border-glass: rgba(255, 255, 255, 0.05);
  --z-content: 1;
  --z-header: 100;
  --z-mobile-menu: 500;
  --z-floating-controls: 700;
  --z-page-modal: 1000;
  --z-ui-feedback: 2000;
}

body {
  background-color: var(--bg-black);
  color: #fff;
  font-family: "JetBrains Mono", monospace;
  margin: 0;
  line-height: 1.6;
  padding-top: 95px; /* 35px de top-bar + 60px de nav. Evita que el hero se oculte */
}

h1,
h2,
h3,
h4 {
  font-family: "Ethnocentric", sans-serif;
  letter-spacing: 1px;
  margin: 0;
}

/* CONTENEDOR PRINCIPAL */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 5%;
}

/* --- CONFIGURACIÓN GLOBAL DE NAV --- */
nav {
  position: fixed;
  top: 0; /* Ahora el nav manda en la parte superior */
  width: 100%;
  height: 60px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  z-index: 5000; /* Máxima prioridad para cubrir el texto al hacer scroll */
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: center;
}

.top-bar {
  position: fixed;
  top: 60px; /* Se queda anclada exactamente debajo del nav */
  left: 0;
  width: 100%;
  height: 35px;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 4000; /* Un nivel por debajo del nav */
  background: rgba(0, 0, 0, 0.95);
  border-bottom: 1px solid rgba(0, 255, 204, 0.2);
}

.nav-container {
  width: 100%;
  max-width: 1200px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 5%;
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.isologo-nav {
  height: 25px;
}
.logo-text-nav {
  height: 18px;
}

.text-mobile {
  display: none;
}

.top-bar p {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.65rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin: 0;
  background: linear-gradient(90deg, #00ffcc, #a855f7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: bold;
  text-align: center;
  width: 100%;
}

/* --- PC: ENLACES --- */
.nav-links {
  display: flex;
  list-style: none;
  gap: 25px;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: #fff;
  font-size: 0.7rem;
  font-weight: bold;
  letter-spacing: 1px;
  transition: 0.3s;
}

.nav-links a:hover {
  color: var(--neon-cyan);
}

.menu-toggle {
  display: none; /* Oculto en PC por defecto */
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  z-index: 6500;
}

.menu-toggle .bar {
  width: 25px;
  height: 2px;
  background-color: #fff;
  transition: all 0.3s ease;
}

/* --- MÓVIL: HAMBURGUESA --- */
@media (max-width: 850px) {
  body {
    padding-top: 95px; /* Sigue igual: 60px del nav + 35px de la top-bar */
  }

  nav {
    top: 0;
    width: 100%;
  }

  .menu-toggle {
    display: flex !important;
    position: fixed;
    top: 17px; /* Perfectamente centrado en la altura de 60px del nav */
    right: 5%;
    z-index: 6500;
    cursor: pointer;
  }

  /* Corrección de la barra superior en móvil */
  .top-bar {
    padding: 0 15px;
    box-sizing: border-box;
  }

  .top-bar p {
    font-size: 0.55rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    text-align: center;
  }

  /* Animación de la Hamburguesa a 'X' */
  .menu-toggle.is-active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
    background-color: var(--neon-cyan);
  }
  .menu-toggle.is-active .bar:nth-child(2) {
    opacity: 0;
  }
  .menu-toggle.is-active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
    background-color: var(--neon-cyan);
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.98);
    backdrop-filter: blur(25px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 35px;
    padding: 0;
    margin: 0;
    list-style: none;
    transition: 0.5s cubic-bezier(0.77, 0, 0.175, 1);
    z-index: 6000; /* Mayor que la top-bar (5000) para cubrirla al abrirse */
  }

  .nav-links.active {
    right: 0;
  }

  .nav-links li {
    width: 100%;
    text-align: center;
  }

  .nav-links a {
    font-size: 1.5rem;
    font-family: "Ethnocentric", sans-serif;
    display: block;
    width: 100%;
  }

  .logo-text-nav {
    display: none;
  }
}

/* HERO */
.hero {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding-top: 20px; /* Compensación ajustada porque el body ya tiene padding */
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: 1200px;
  padding: 0 5%;
}

.hero-video {
  background: #050505;
  display: block;
  object-fit: contain;
  width: 220px;
}

.hero-identity {
  width: 350px;
  max-width: 80%;
  margin-bottom: 15px;
}

.hero-subtitle {
  font-size: 0.8rem;
  color: var(--neon-cyan);
  letter-spacing: 5px;
}

/* --- VISTA ESCRITORIO (PC): SPLIT LAYOUT --- */
@media (min-width: 850px) {
  .hero-content {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
    gap: 50px;
  }

  .hero-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
  }

  .hero-video {
    width: 320px;
  }

  .hero-identity {
    width: 450px;
    max-width: 100%;
  }
}

/* SECCIÓN INVITACIONES */
.section {
  padding: 80px 0;
}
.section-heading {
  text-align: center;
  margin-bottom: 50px;
  font-size: 1.5rem;
  opacity: 0.9;
}

.invitaciones-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  justify-items: center;
}

.inv-card {
  position: relative;
  width: 100%;
  max-width: 280px;
  aspect-ratio: 9 / 16;
  background: rgba(15, 15, 15, 0.7);
  backdrop-filter: blur(15px);
  border-radius: 35px;
  border: 1px solid var(--border-glass);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden; /* Evita que el notch se salga */
}

.inv-card:hover {
  transform: translateY(-10px);
  border-color: var(--accent-purple);
}

.preview-box {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
}
.preview-box video,
.preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-info {
  padding: 25px;
  text-align: center;
}
.card-tag {
  font-size: 0.6rem;
  color: var(--text-dim);
}
.card-info h3 {
  font-size: 1rem;
  margin: 10px 0 20px;
}

.card-actions {
  display: grid;
  gap: 10px;
}
.btn-action-primary {
  background: var(--accent-purple);
  color: #fff;
  text-decoration: none;
  padding: 12px;
  font-size: 0.7rem;
  border-radius: 5px;
}
.btn-action-secondary {
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan);
  text-decoration: none;
  padding: 12px;
  font-size: 0.7rem;
  border-radius: 5px;
}

/* PROTOCOLO TÉCNICO / SERVICIOS */
.protocolo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.proto-card {
  background: var(--card-dark);
  padding: 40px 20px;
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.proto-icon {
  width: 100%;
  height: 110px;
  object-fit: contain;
  margin-bottom: 20px;
  z-index: 2;
}

.proto-body {
  z-index: 2;
  width: 100%;
}

.num {
  font-size: 5rem;
  color: rgba(255, 255, 255, 0.06);
  position: absolute;
  top: -10px;
  right: 15px;
  font-weight: 900;
  pointer-events: none;
  user-select: none;
  z-index: 1;
}

@media (max-width: 850px) {
  .num {
    color: rgba(255, 255, 255, 0.1);
    font-size: 4rem;
  }
}

/* ESTADÍSTICAS */
.stats-container {
  margin-top: 60px;
  padding: 40px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  justify-content: space-around;
  border-radius: 20px;
  flex-wrap: wrap;
  gap: 30px;
}
.stat-item h4 {
  font-size: 2rem;
  color: #fff;
}
.stat-item p {
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* HELIX ADVENTURE BANNER */
.adventure-banner {
  background: linear-gradient(90deg, #0a0a0a, #151515);
  border: 1px solid var(--accent-purple);
  padding: 40px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 40px;
  margin: 40px 0;
}
.adventure-img {
  width: 120px;
}
.helix-files-img {
  border-radius: 16px;
  max-width: min(100%, 420px);
  width: 42%;
}
.adventure-text h3 {
  margin-bottom: 10px;
  color: var(--accent-purple);
}
.adventure-text p {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 20px;
}

/* FOOTER */
footer {
  padding: 60px 0;
  border-top: 1px solid var(--border-glass);
  text-align: center;
}
.footer-grid {
  display: flex;
  justify-content: center;
  gap: 100px;
  margin-bottom: 40px;
}
.footer-logo {
  height: 40px;
  margin-bottom: 15px;
}

/* --- REDISEÑO QUIRÚRGICO WIDGET HELIX --- */
.helix-widget {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 15px;
}

.helix-trigger {
  width: 70px;
  height: 70px;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition:
    transform 0.3s ease,
    border-color 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.helix-trigger:hover {
  transform: scale(1.05);
  border-color: var(--neon-cyan);
}

.helix-img-trigger {
  width: 50px;
}

.helix-menu {
  position: absolute;
  bottom: 90px;
  right: 0;
  background: rgba(5, 5, 5, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-top: 2px solid var(--neon-cyan);
  border-radius: 12px;
  padding: 15px 10px;
  display: none;
  flex-direction: column;
  gap: 5px;
  min-width: 240px;
  box-shadow:
    0 15px 35px rgba(0, 0, 0, 0.8),
    0 -5px 20px rgba(0, 255, 204, 0.1);
}

.helix-menu.active {
  display: flex;
  animation: slideUpFade 0.4s ease forwards;
}

.menu-item {
  text-decoration: none;
  color: #aaa;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  font-weight: bold;
  padding: 12px 15px;
  border-radius: 6px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 12px;
  border-left: 2px solid transparent;
}

.tech-arrow {
  color: var(--accent-purple);
  font-weight: 900;
  opacity: 0.5;
  transition: 0.3s;
}

.menu-item:hover {
  background: linear-gradient(90deg, rgba(0, 255, 204, 0.1), transparent);
  color: #fff;
  border-left: 2px solid var(--neon-cyan);
}

.menu-item:hover .tech-arrow {
  color: var(--neon-cyan);
  opacity: 1;
  transform: translateX(4px);
}

/* Desbloqueo del widget de Helix en móvil */
.chat-bubble {
  background: #fff !important; /* Obliga al fondo a ser blanco */
  color: #000 !important; /* Obliga al texto a ser negro */
  font-size: 0.65rem;
  padding: 8px 10px;
  min-width: 140px;
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.preview-box {
  filter: blur(10px) grayscale(0.5);
  transition:
    filter 0.6s ease,
    transform 0.6s ease;
}

.inv-card:hover .preview-box,
.inv-card.is-active .preview-box {
  filter: blur(0) grayscale(0);
}

.btn-action-primary {
  background: #a855f7;
  color: white;
}

.btn-action-secondary {
  border: 1px solid #00ffcc;
  color: #00ffcc;
}

/* DISEÑO DE TARJETAS RECTANGULARES (ESTILO MÓVIL) */
.invitaciones-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 30px;
  padding: 20px;
  justify-items: center;
}

.inv-card {
  position: relative;
  width: 100%;
  max-width: 280px;
  aspect-ratio: 9 / 16;
  background: rgba(15, 15, 15, 0.7);
  backdrop-filter: blur(15px) saturate(160%);
  -webkit-backdrop-filter: blur(15px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 35px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 18px;
  background: #000;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  z-index: 10;
}

.inv-card:hover {
  transform: scale(1.03) translateY(-10px);
  border-color: var(--neon-cyan);
  box-shadow: 0 15px 45px rgba(0, 255, 204, 0.15);
}

.preview-box {
  flex: 1;
  overflow: hidden;
  filter: blur(20px) brightness(0.4);
  transition: all 0.7s ease;
}

.inv-card:hover .preview-box,
.inv-card.is-active .preview-box {
  filter: blur(0) brightness(1);
}

.preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-content {
  padding: 20px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  text-align: center;
}

.card-header h3 {
  font-family: "Ethnocentric", sans-serif;
  font-size: 0.8rem;
  margin-bottom: 15px;
  color: #fff;
}

.card-tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.55rem;
  color: var(--neon-cyan);
  letter-spacing: 1px;
}

.card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-modern-primary,
.btn-modern-ghost {
  font-size: 0.6rem;
  padding: 10px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: bold;
  transition: 0.3s;
}

.btn-modern-primary {
  background: #fff;
  color: #000;
}

.btn-modern-ghost {
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
}

.btn-catalog,
.btn-download {
  display: inline-block;
  padding: 15px 35px;
  border-radius: 50px;
  font-family: "Ethnocentric", sans-serif;
  font-size: 0.7rem;
  text-decoration: none;
  letter-spacing: 2px;
  transition: all 0.3s ease;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan);
  background: transparent;
  box-shadow: 0 0 10px rgba(0, 255, 204, 0.2);
}

.btn-catalog:hover,
.btn-download:hover {
  background: var(--neon-cyan);
  color: #000;
  box-shadow: 0 0 25px var(--neon-cyan);
  transform: translateY(-3px);
}

.btn-white.special {
  background: transparent;
  border: 1px solid var(--accent-purple);
  color: var(--accent-purple);
}

.btn-white.special:hover {
  background: var(--accent-purple);
  color: #fff;
  box-shadow: 0 0 25px var(--accent-purple);
}

.helix-adventure-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.helix-adventure-actions .btn-download,
.helix-adventure-actions .btn-catalog {
  margin: 0;
}

.install-secondary {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(0, 255, 204, 0.5);
  color: var(--neon-cyan);
  cursor: pointer;
}

.install-secondary:hover,
.install-secondary:focus-visible {
  background: rgba(0, 255, 204, 0.12);
  border-color: var(--neon-cyan);
  color: #ffffff;
}

.install-secondary:disabled,
.install-secondary[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.62;
}

.helix-install-status {
  flex-basis: 100%;
  margin: 0;
  max-width: 440px;
  color: #cbd5e1;
  font-size: 0.74rem;
  line-height: 1.5;
}

.helix-files-section .adventure-text h3,
.helix-files-accent {
  color: #e62117;
}

.helix-files-section .btn-white.special,
.helix-files-button {
  border-color: #e62117;
  color: #e62117;
}

.helix-files-section .btn-white.special:hover,
.helix-files-button:hover {
  background: #e62117;
  color: #fff;
  box-shadow: 0 0 25px rgba(230, 33, 23, 0.35);
}

@media (max-width: 850px) {
  .nav-links {
    position: fixed;
    top: 74px;
    left: 50%;
    right: auto;
    width: min(100% - 32px, 360px);
    height: auto;
    max-height: calc(100dvh - 100px);
    background: rgba(6, 6, 6, 0.96);
    backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: flex-start;
    gap: 12px;
    opacity: 0;
    overflow-y: auto;
    padding: 18px;
    pointer-events: none;
    transform: translate(-50%, -10px) scale(0.98);
    transition:
      opacity 0.24s ease,
      transform 0.24s ease;
    border: 1px solid rgba(0, 255, 204, 0.18);
    border-radius: 18px;
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.58);
    z-index: 6000;
  }

  .nav-links.active {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0) scale(1);
  }

  .adventure-banner {
    flex-direction: column !important;
    text-align: center;
    padding: 40px 20px;
    margin: 20px 5%;
    gap: 20px;
  }

  .adventure-img {
    width: 140px;
    margin-bottom: 10px;
  }

  .adventure-text h3 {
    font-size: 1.2rem;
  }

  .footer-grid {
    flex-direction: column;
    gap: 50px;
    text-align: center;
  }

  .footer-brand,
  .footer-col {
    align-items: center;
    display: flex;
    flex-direction: column;
  }

  .chat-bubble {
    font-size: 0.65rem;
    padding: 8px 10px;
    min-width: 140px;
  }

  .helix-widget {
    bottom: 20px;
    right: 20px;
    gap: 10px;
  }

  .helix-trigger {
    width: 60px;
    height: 60px;
  }
}

.estudio-grid {
  display: flex;
  align-items: center;
  gap: 50px;
  background: rgba(10, 10, 10, 0.6);
  backdrop-filter: blur(15px);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 50px;
  margin-bottom: 40px;
}

.estudio-grid.reverse {
  flex-direction: row-reverse;
}

.estudio-text {
  flex: 1;
  text-align: left;
}

.estudio-text p {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 15px;
}

.estudio-visual {
  flex: 1;
  display: flex;
  justify-content: center;
  background: transparent;
  padding: 0;
  border: none;
}

@media (max-width: 850px) {
  .estudio-grid,
  .estudio-grid.reverse {
    flex-direction: column;
    padding: 30px;
    text-align: center;
  }
  .estudio-text {
    text-align: center;
  }
}

a.link-card {
  text-decoration: none;
  color: inherit;
  transition:
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.4s ease,
    box-shadow 0.4s ease;
  border: 1px solid transparent;
}

a.link-card p {
  margin-bottom: 15px;
  font-size: 0.75rem;
}

.card-link-text {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.65rem;
  font-weight: bold;
  letter-spacing: 1px;
  opacity: 0.6;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
  display: inline-block;
}

a.link-card:hover {
  transform: translateY(-10px);
  background: rgba(15, 15, 15, 0.9);
}

a.link-card:hover .card-link-text {
  opacity: 1;
  transform: translateX(5px);
}

a.link-card:nth-child(1):hover {
  border-color: var(--accent-purple);
  box-shadow: 0 10px 30px rgba(168, 85, 247, 0.15);
}

a.link-card:nth-child(2):hover {
  border-color: var(--neon-cyan);
  box-shadow: 0 10px 30px rgba(0, 255, 204, 0.15);
}

a.link-card:nth-child(3):hover {
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 10px 30px rgba(255, 255, 255, 0.05);
}

.true-carousel-wrapper {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 15px;
}

.true-carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  gap: 20px;
  flex: 1;
  border-radius: 20px;
  padding-bottom: 10px;
}

.true-carousel-track::-webkit-scrollbar {
  display: none;
}

.true-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
  background: rgba(15, 15, 15, 0.7);
  backdrop-filter: blur(15px);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  overflow: hidden;
}

.slide-image-box {
  width: 100%;
  height: 350px;
  background: #050505;
  display: flex;
  justify-content: center;
  align-items: center;
}

.slide-image-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 20px;
}

.slide-text {
  padding: 30px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.slide-text h4 {
  font-family: "Ethnocentric", sans-serif;
  font-size: 0.9rem;
  margin-bottom: 15px;
}

.slide-text p {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.carousel-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid var(--border-glass);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s ease;
  z-index: 10;
}

.carousel-btn:hover {
  background: var(--neon-cyan);
  color: #000;
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(0, 255, 204, 0.4);
}

@media (max-width: 850px) {
  .carousel-btn {
    display: none;
  }
  .slide-image-box {
    height: 250px;
  }
}

.modal {
  display: none;
  position: fixed;
  z-index: 4000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(15px);
  justify-content: center;
  align-items: center;
}

.modal.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

.modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 800px;
  padding: 0 20px;
}

.modal-content {
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 0 30px rgba(0, 255, 204, 0.2);
  margin-bottom: 25px;
}

.modal-caption {
  text-align: center;
  color: white;
}

.modal-caption h4 {
  font-family: "Ethnocentric", sans-serif;
  font-size: 1rem;
  color: var(--neon-cyan);
  margin-bottom: 10px;
}

.modal-caption p {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
  color: #ccc;
  line-height: 1.5;
}

.modal-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid var(--border-glass);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  z-index: 4001;
  transition: all 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-btn:hover {
  background: var(--neon-cyan);
  color: #000;
  box-shadow: 0 0 20px rgba(0, 255, 204, 0.5);
  transform: translateY(-50%) scale(1.1);
}

.prev-modal {
  left: 5%;
}
.next-modal {
  right: 5%;
}

.close-modal {
  background: transparent;
  border: 0;
  position: absolute;
  top: 20px;
  right: 40px;
  color: #fff;
  font-size: 45px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s ease;
  z-index: 4001;
}

.close-modal:hover {
  color: var(--neon-cyan);
}

@media (max-width: 850px) {
  .prev-modal {
    left: 2%;
    width: 40px;
    height: 40px;
  }
  .next-modal {
    right: 2%;
    width: 40px;
    height: 40px;
  }
  .modal-content {
    max-height: 50vh;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.iframe-container {
  position: relative;
  width: 90vw;
  max-width: 375px;
  height: 75vh;
  max-height: 800px;
  background: #050505;
  border-radius: 35px;
  border: 2px solid var(--neon-cyan);
  overflow: hidden;
  box-shadow:
    0 0 40px rgba(0, 255, 204, 0.2),
    inset 0 0 20px rgba(0, 0, 0, 1);
  display: flex;
  justify-content: center;
  align-items: center;
}

#preview-frame {
  position: relative;
  width: 100%;
  height: 100%;
  border: none;
  z-index: 2;
  background: #000;
}

.iframe-loader {
  position: absolute;
  color: var(--neon-cyan);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  z-index: 1;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.5;
  }
}

/* Intercambio de texto */
.text-desktop {
  display: none !important;
}
.text-mobile {
  display: block !important;
}

/* Aseguramos que en móvil el texto baje de tamaño y NO pierda el color */
.top-bar p {
  white-space: normal !important;
  overflow: visible !important;
  font-size: 0.55rem !important;
  /* Candado para el degradado en móvil */
  background: linear-gradient(90deg, #00ffcc, #a855f7) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  color: transparent !important;
}

@media (max-width: 600px) {
  .chat-bubble {
    background: #fff !important;
    color: #000 !important;
    font-size: 0.65rem;
    padding: 8px 10px;
    min-width: 140px;
    pointer-events: none !important; /* Para que no estorbe toques */
  }

  .helix-widget {
    bottom: 20px;
    right: 20px;
    gap: 10px;
  }

  .helix-trigger {
    width: 60px;
    height: 60px;
  }
}

/* ESTILOS DEL FORMULARIO DE CONTACTO */
.form-input {
  width: 100%;
  padding: 12px 15px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.form-input:focus {
  outline: none;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 255, 204, 0.2);
  background: rgba(0, 0, 0, 0.8);
}

.form-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* Ajuste para los select en modo oscuro */
select.form-input option {
  background: var(--bg-black);
  color: #fff;
}

.brand-link {
  align-items: center;
  display: flex;
  gap: 12px;
  text-decoration: none;
}

.lang-toggle {
  background: transparent;
  border: 1px solid var(--neon-cyan);
  border-radius: 8px;
  color: var(--neon-cyan);
  cursor: pointer;
  font-family: "JetBrains Mono", monospace;
  font-weight: bold;
  min-height: 44px;
  padding: 0 14px;
  transition: 0.3s;
}

.sr-only {
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

/* Resaltar campos incompletos o incorrectos con estilo Neón de Alerta */
.form-input:focus:invalid {
  border-color: #ff3366;
  box-shadow: 0 0 10px rgba(255, 51, 102, 0.3);
  background: rgba(20, 0, 0, 0.8);
}

/* FASE 5D: responsive and accessibility polish */
html,
body {
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
}

button,
a,
.btn-catalog,
.btn-white,
.btn-modern-primary,
.btn-modern-ghost,
.btn-download {
  min-height: 44px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--neon-cyan);
  outline-offset: 3px;
}

.modal {
  padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
}

.modal-body {
  max-height: min(88vh, 760px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.close-modal {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
}

@media (max-width: 768px) {
  .modal {
    align-items: flex-start;
  }

  .modal-body {
    border-radius: 14px !important;
    max-height: calc(100vh - 28px);
    padding: 22px !important;
    width: min(100%, 560px) !important;
  }

  .true-carousel-wrapper {
    padding: 0 4px;
  }

  .true-carousel-track {
    gap: 14px;
    scroll-padding: 8px;
  }

  .true-slide {
    min-width: min(86vw, 360px);
  }

  .carousel-btn,
  .modal-btn {
    min-height: 44px;
    min-width: 44px;
  }

  .slide-text {
    padding: 14px;
  }

  .slide-text p {
    font-size: 0.78rem;
    line-height: 1.45;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* FASE 5D.1: floating stack, mobile menu, carousel and lightbox fixes */
.mobile-lang-switch {
  display: none;
}

.carousel-btn svg,
.modal-btn svg {
  height: 24px;
  width: 24px;
}

.true-carousel-wrapper {
  cursor: grab;
  outline: none;
  padding-bottom: 34px;
}

.true-carousel-wrapper:focus-visible {
  outline: 2px solid var(--neon-cyan);
  outline-offset: 4px;
}

.carousel-indicator,
.carousel-hint {
  color: var(--text-dim);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  margin-top: 10px;
  text-align: center;
}

.carousel-indicator {
  color: var(--neon-cyan);
}

.carousel-hint.is-hidden {
  opacity: 0;
}

.modal-counter {
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(0, 255, 204, 0.32);
  border-radius: 999px;
  color: var(--neon-cyan);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  left: 50%;
  padding: 6px 12px;
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  transform: translateX(-50%);
  z-index: calc(var(--z-page-modal) + 2);
}

.modal.active ~ .helix-widget,
body.modal-open .helix-widget,
body.modal-open .admin-shortcut {
  opacity: 0;
  pointer-events: none;
}

body.modal-open {
  overflow: hidden;
}

@media (min-width: 769px) {
  .admin-shortcut {
    right: calc(112px + env(safe-area-inset-right)) !important;
  }
}

@media (max-width: 768px) {
  nav {
    z-index: var(--z-header) !important;
  }

  .menu-toggle {
    min-height: 44px;
    min-width: 44px;
    z-index: calc(var(--z-mobile-menu) + 2) !important;
  }

  .nav-links {
    gap: 16px !important;
    height: 100dvh !important;
    justify-content: flex-start !important;
    max-height: 100dvh;
    overflow-y: auto;
    padding: 92px 20px 28px !important;
    z-index: var(--z-mobile-menu) !important;
  }

  .nav-links a {
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    display: flex !important;
    font-size: clamp(1rem, 6vw, 1.3rem) !important;
    justify-content: center;
    min-height: 50px;
    padding: 10px 12px;
  }

  #lang-toggle {
    display: none !important;
  }

  .mobile-lang-switch {
    color: var(--text-dim);
    display: grid;
    font-family: "JetBrains Mono", monospace;
    gap: 8px;
    justify-items: center;
    width: 100%;
  }

  .mobile-lang-options {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(88px, 1fr));
    width: min(100%, 240px);
  }

  .mobile-lang-options button {
    background: rgba(0, 0, 0, 0.65);
    border: 1px solid rgba(0, 255, 204, 0.34);
    border-radius: 10px;
    color: var(--neon-cyan);
    font-family: "JetBrains Mono", monospace;
    font-weight: 900;
    min-height: 44px;
  }

  .mobile-lang-options button.active {
    background: var(--neon-cyan);
    color: #050505;
  }

  .helix-widget {
    z-index: var(--z-floating-controls) !important;
  }

  body.menu-open .helix-widget {
    opacity: 0;
    pointer-events: none;
  }

  .carousel-btn {
    bottom: 0;
    display: flex !important;
    top: auto;
    transform: none;
  }

  .carousel-btn:hover {
    transform: none;
  }

  .prev-btn {
    left: calc(50% - 58px);
  }

  .next-btn {
    right: calc(50% - 58px);
  }

  .modal.active {
    z-index: var(--z-page-modal) !important;
  }

  .modal-btn {
    bottom: max(18px, env(safe-area-inset-bottom));
    top: auto;
    transform: none;
  }

  .modal-btn:hover {
    transform: none;
  }

  .prev-modal {
    left: calc(50% - 58px);
  }

  .next-modal {
    right: calc(50% - 58px);
  }

  .close-modal {
    right: max(12px, env(safe-area-inset-right));
    top: max(10px, env(safe-area-inset-top));
  }

  .modal-caption {
    padding-bottom: 62px;
  }

  #contact-modal .modal-body {
    width: min(100% - 24px, 500px) !important;
  }
}

@media (max-width: 430px) {
  .btn-catalog,
  .btn-white,
  .btn-modern-primary,
  .btn-modern-ghost,
  .btn-download {
    line-height: 1.25;
    padding-left: 14px;
    padding-right: 14px;
    white-space: normal;
  }

  .card-actions {
    gap: 10px;
  }
}

/* FASE 5E: Studio 2.0 premium portfolio */
.studio-page {
  padding-top: 72px;
}

.studio-shell {
  margin: 0 auto;
  max-width: 1180px;
  padding: 0 clamp(16px, 4vw, 48px) 96px;
}

.studio-hero {
  padding: clamp(72px, 12vw, 140px) 0 clamp(42px, 8vw, 88px);
  text-align: center;
}

.eyebrow,
.portfolio-kicker {
  color: var(--neon-cyan);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  margin: 0 0 14px;
  text-transform: uppercase;
}

.studio-hero h1 {
  font-size: clamp(2rem, 8vw, 5.8rem);
  line-height: 0.96;
  margin: 0 auto 22px;
  max-width: 980px;
}

.studio-hero p:not(.eyebrow) {
  color: #b6c2d4;
  font-size: clamp(0.95rem, 2vw, 1.18rem);
  line-height: 1.7;
  margin: 0 auto;
  max-width: 760px;
}

.portfolio-section {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  gap: clamp(22px, 4vw, 40px);
  padding: clamp(56px, 10vw, 110px) 0;
}

.portfolio-media {
  background:
    radial-gradient(circle at 50% 0%, rgba(0, 255, 204, 0.08), transparent 45%),
    #060606;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: clamp(18px, 3vw, 30px);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.34);
  margin: 0;
  overflow: hidden;
  padding: clamp(18px, 4vw, 48px);
}

.portfolio-media img {
  display: block;
  height: clamp(260px, 54vw, 620px);
  object-fit: contain;
  width: 100%;
}

.portfolio-media-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portfolio-media-grid img {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 20px;
  height: clamp(220px, 38vw, 520px);
}

.portfolio-copy {
  max-width: 820px;
}

.portfolio-copy h2 {
  font-size: clamp(1.55rem, 5vw, 3.6rem);
  line-height: 1.05;
  margin-bottom: 18px;
}

.portfolio-copy p:not(.portfolio-kicker) {
  color: #b6c2d4;
  font-size: clamp(0.92rem, 1.5vw, 1.08rem);
  line-height: 1.75;
  margin: 0 0 22px;
}

.tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 26px;
}

.tech-list span {
  background: rgba(0, 255, 204, 0.08);
  border: 1px solid rgba(0, 255, 204, 0.2);
  border-radius: 999px;
  color: #dffef8;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  padding: 8px 11px;
}

.contact-panel {
  background: rgba(10, 10, 10, 0.94);
  border: 1px solid var(--neon-cyan);
  border-radius: 20px;
  max-width: 520px;
  padding: clamp(20px, 4vw, 40px);
  width: min(100% - 24px, 520px);
}

.contact-panel h3 {
  color: var(--neon-cyan);
  font-size: clamp(1rem, 4vw, 1.35rem);
  margin-bottom: 10px;
  text-align: center;
}

.contact-panel p {
  color: var(--text-dim);
  font-size: 0.82rem;
  line-height: 1.55;
  margin: 0 0 22px;
  text-align: center;
}

.contact-form {
  display: grid;
  gap: 14px;
  width: 100%;
}

.contact-form textarea {
  resize: vertical;
}

@media (max-width: 768px) {
  .studio-page {
    padding-top: 64px;
  }

  .studio-shell {
    padding-left: 14px;
    padding-right: 14px;
  }

  .portfolio-section {
    padding: 50px 0;
  }

  .portfolio-media {
    border-radius: 18px;
    padding: 14px;
  }

  .portfolio-media img,
  .portfolio-media-grid img {
    height: auto;
    max-height: 62vh;
    min-height: 220px;
  }

  .portfolio-media-grid {
    grid-template-columns: 1fr;
  }

  .portfolio-copy .btn-catalog {
    text-align: center;
    width: 100%;
  }

  .tech-list span {
    flex: 1 1 calc(50% - 10px);
    text-align: center;
  }
}

@media (max-width: 768px) {
  .nav-links {
    align-items: stretch !important;
    border-radius: 18px !important;
    gap: 10px !important;
    height: auto !important;
    left: 50% !important;
    max-height: calc(100dvh - 92px) !important;
    overflow-y: auto !important;
    padding: 18px !important;
    right: auto !important;
    top: 72px !important;
    transform: translate(-50%, -10px) scale(0.98) !important;
    width: min(100% - 28px, 360px) !important;
  }

  .nav-links.active {
    right: auto !important;
    transform: translate(-50%, 0) scale(1) !important;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    font-size: clamp(0.82rem, 4vw, 1.02rem) !important;
    min-height: 48px;
  }
}

/* FASE 5E.1: final UX/UI proportions and premium polish */
.btn-catalog,
.btn-download,
.btn-modern-primary,
.btn-modern-ghost,
.btn-white {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  line-height: 1.2;
  min-height: 44px;
  width: auto;
}

.btn-catalog,
.btn-download {
  font-size: clamp(0.72rem, 1vw, 0.82rem);
  padding: 13px 24px;
}

.preview-box,
.portfolio-media,
.portfolio-gallery img {
  background:
    linear-gradient(90deg, rgba(17, 24, 39, 0.72), rgba(51, 65, 85, 0.28), rgba(17, 24, 39, 0.72)),
    #050505;
  background-size: 220% 100%;
}

button:disabled,
.btn-catalog:disabled,
.btn-white:disabled,
.btn-modern-primary:disabled,
.btn-modern-ghost:disabled {
  cursor: wait;
  opacity: 0.68;
  transform: none !important;
}

.btn-modern-primary,
.btn-modern-ghost {
  font-size: clamp(0.68rem, 1vw, 0.78rem);
  padding: 11px 14px;
}

.cta-primary {
  background: linear-gradient(135deg, var(--neon-cyan), #8b5cf6) !important;
  border: 1px solid rgba(255, 255, 255, 0.78) !important;
  color: #020617 !important;
  font-weight: 900;
  letter-spacing: 0.08em;
  min-height: 50px;
  padding: 15px 30px;
  box-shadow:
    0 0 0 1px rgba(0, 255, 204, 0.28),
    0 14px 34px rgba(0, 255, 204, 0.22),
    0 0 28px rgba(139, 92, 246, 0.22);
  transform: translateZ(0);
}

.cta-secondary {
  background: rgba(0, 255, 204, 0.06);
  border-color: rgba(0, 255, 204, 0.5);
  color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(0, 255, 204, 0.12);
}

.btn-modern-primary,
.btn-modern-ghost,
.btn-download,
.btn-white:not(.cta-primary) {
  box-shadow: none;
}

.cta-primary:hover,
.cta-primary:focus-visible {
  background: linear-gradient(135deg, #ffffff, var(--neon-cyan)) !important;
  color: #020617 !important;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.62),
    0 18px 42px rgba(0, 255, 204, 0.3),
    0 0 34px rgba(139, 92, 246, 0.3);
  transform: translateY(-2px) scale(1.015);
}

.cta-secondary:hover,
.cta-secondary:focus-visible {
  background: rgba(0, 255, 204, 0.14);
  border-color: var(--neon-cyan);
  box-shadow: 0 10px 24px rgba(0, 255, 204, 0.16);
  color: var(--neon-cyan);
  transform: translateY(-1px);
}

.btn-modern-primary,
.btn-modern-ghost {
  opacity: 0.92;
}

.center-btn .btn-catalog {
  min-width: 0;
  width: auto;
}

.portfolio-section {
  gap: clamp(18px, 3vw, 30px);
}

.portfolio-copy {
  margin-top: -6px;
}

.portfolio-copy .btn-catalog {
  min-width: 0;
  padding-inline: 22px;
}

.portfolio-gallery {
  display: grid;
  gap: clamp(12px, 2vw, 18px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: clamp(10px, 2vw, 18px);
}

.portfolio-gallery img {
  background: #050505;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  display: block;
  height: clamp(180px, 24vw, 320px);
  object-fit: contain;
  padding: 12px;
  width: 100%;
}

.studio-final-cta {
  border: 1px solid rgba(0, 255, 204, 0.18);
  border-radius: 28px;
  margin: clamp(34px, 7vw, 80px) 0 0;
  padding: clamp(26px, 6vw, 64px);
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(0, 255, 204, 0.1), transparent 44%),
    rgba(10, 10, 10, 0.78);
}

.studio-final-cta h2 {
  font-size: clamp(1.4rem, 5vw, 3.2rem);
  line-height: 1.05;
  margin-bottom: 14px;
}

.studio-final-cta p:not(.eyebrow) {
  color: #b6c2d4;
  margin: 0 auto 24px;
  max-width: 680px;
}

.menu-toggle {
  appearance: none;
  -webkit-appearance: none;
  background: transparent !important;
  border: 0 !important;
  padding: 0;
}

.menu-toggle:focus-visible {
  outline: 2px solid var(--neon-cyan);
  outline-offset: 5px;
}

.nav-links {
  padding-left: 0;
}

@media (max-width: 768px) {
  .nav-links {
    background: rgba(6, 6, 6, 0.97) !important;
    border: 1px solid rgba(0, 255, 204, 0.22) !important;
    border-radius: 18px !important;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.6) !important;
    gap: 10px !important;
    height: auto !important;
    left: 50% !important;
    margin: 0 !important;
    max-height: calc(100dvh - 96px) !important;
    overflow-y: auto !important;
    padding: 16px !important;
    right: auto !important;
    top: 72px !important;
    transform: translate(-50%, -10px) scale(0.98) !important;
    width: min(calc(100vw - 32px), 360px) !important;
  }

  .nav-links.active {
    transform: translate(-50%, 0) scale(1) !important;
  }

  .nav-links a {
    border-radius: 10px;
    font-size: clamp(0.82rem, 3.8vw, 1rem) !important;
    min-height: 46px;
  }

  .mobile-lang-switch {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 4px;
    padding-top: 12px;
  }

  .mobile-lang-options {
    display: inline-grid;
    grid-template-columns: repeat(2, 58px);
    justify-content: center;
    width: auto;
  }

  .mobile-lang-options button {
    min-height: 40px;
    padding: 0 10px;
  }

  .portfolio-gallery {
    grid-template-columns: 1fr;
  }

  .helix-files-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .helix-files-img {
    width: 100%;
  }

  .portfolio-gallery img {
    height: auto;
    max-height: 52vh;
    min-height: 180px;
  }

  .center-btn .btn-catalog,
  .portfolio-copy .btn-catalog,
  .studio-final-cta .btn-catalog {
    width: min(100%, 360px);
  }

  .contact-panel,
  #contact-modal .modal-body {
    max-height: 90dvh !important;
    overflow-y: auto;
    padding: 18px !important;
    width: min(calc(100vw - 24px), 520px) !important;
  }

  .contact-form,
  #contact-modal form {
    min-width: 0;
    width: 100%;
  }

  .contact-form input,
  .contact-form select,
  .contact-form textarea,
  #contact-modal input,
  #contact-modal select,
  #contact-modal textarea {
    box-sizing: border-box;
    min-width: 0;
    width: 100%;
  }
}


/* FINAL MOBILE ALIGNMENT PATCH — 3DXPANSION */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

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

nav,
.top-bar {
  left: 0;
  right: 0;
}

.nav-container,
.studio-shell,
.container,
.portfolio-section,
.portfolio-media,
.portfolio-copy,
.portfolio-gallery,
.contact-panel {
  min-width: 0;
}

.nav-container,
.studio-shell,
.container {
  width: 100%;
}


.portfolio-gallery > * {
  min-width: 0;
}

.portfolio-gallery img {
  box-sizing: border-box;
}

.mobile-lang-toggle {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(0, 255, 204, 0.08);
  border: 1px solid rgba(0, 255, 204, 0.38);
  border-radius: 10px;
  color: var(--neon-cyan);
  cursor: pointer;
  font-family: "JetBrains Mono", monospace;
  font-weight: 900;
  min-height: 44px;
  min-width: 72px;
  padding: 0 16px;
}

.mobile-lang-toggle:hover,
.mobile-lang-toggle:focus-visible {
  background: var(--neon-cyan);
  color: #050505;
}

@media (max-width: 768px) {
  body {
    width: 100%;
  }

  .nav-container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .menu-toggle {
    right: 16px !important;
  }

  .nav-links {
    box-sizing: border-box !important;
    left: 50vw !important;
    right: auto !important;
    width: calc(100vw - 24px) !important;
    max-width: 360px !important;
    padding: 14px !important;
    transform: translate3d(-50%, -10px, 0) scale(0.98) !important;
  }

  .nav-links.active {
    transform: translate3d(-50%, 0, 0) scale(1) !important;
  }

  .nav-links li,
  .nav-links a,
  .mobile-lang-switch {
    width: 100%;
    min-width: 0;
  }

  .mobile-lang-switch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .mobile-lang-options {
    display: none !important;
  }

  .studio-shell {
    box-sizing: border-box;
    padding-left: 12px;
    padding-right: 12px;
  }

  .studio-hero,
  .portfolio-section,
  .studio-final-cta {
    width: 100%;
  }

  .portfolio-media,
  .portfolio-copy,
  .portfolio-gallery,
  .studio-final-cta {
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
  }

  .portfolio-gallery {
    width: 100%;
  }

  .portfolio-gallery img {
    width: 100%;
    max-width: 100%;
    padding: 10px;
  }

  .tech-list {
    width: 100%;
  }

  .tech-list span {
    min-width: 0;
  }

  .contact-panel,
  #contact-modal .modal-body {
    box-sizing: border-box !important;
    margin-left: auto;
    margin-right: auto;
    max-width: calc(100vw - 24px) !important;
    width: calc(100vw - 24px) !important;
  }
}

@media (max-width: 380px) {
  .studio-shell {
    padding-left: 10px;
    padding-right: 10px;
  }

  .nav-links {
    width: calc(100vw - 16px) !important;
    padding: 12px !important;
  }

  .portfolio-copy h2,
  .studio-final-cta h2 {
    overflow-wrap: anywhere;
  }
}


/* ESTUDIO — alineación editorial centrada en escritorio */
@media (min-width: 769px) {
  .studio-page .portfolio-copy {
    margin-left: auto;
    margin-right: auto;
    max-width: 920px;
    text-align: center;
  }

  .studio-page .portfolio-copy p:not(.portfolio-kicker) {
    margin-left: auto;
    margin-right: auto;
    max-width: 860px;
  }

  .studio-page .tech-list {
    justify-content: center;
  }

  .studio-page .portfolio-copy .btn-catalog {
    margin-left: auto;
    margin-right: auto;
  }
}


/* FINAL POLISH 2026-07-10 — banner, translation tags and feedback layering */
.top-bar {
  z-index: 80 !important;
  padding-inline: 16px;
  box-sizing: border-box;
}

.top-bar #language-banner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-bar #language-banner.is-visible {
  opacity: 1;
  transform: translateY(0);
}

body.modal-open .top-bar,
body.menu-open .top-bar {
  opacity: 0;
  pointer-events: none;
}

nav {
  z-index: var(--z-header) !important;
}

.nav-links {
  z-index: var(--z-mobile-menu) !important;
}

.modal,
#iframe-modal,
#contact-modal {
  z-index: var(--z-page-modal) !important;
}

body > [class*="feedback"],
body > [class*="toast"],
body > [class*="success"],
body > [data-ui-feedback],
body > [role="alertdialog"] {
  position: fixed !important;
  z-index: 12000 !important;
  isolation: isolate;
}

@media (min-width: 769px) {
  .top-bar #language-banner {
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 768px) {
  .top-bar {
    height: auto;
    min-height: 30px;
    top: 60px;
  }

  .top-bar #language-banner {
    font-size: 0.52rem !important;
    letter-spacing: 1px;
    overflow-wrap: anywhere;
    white-space: normal;
  }
}

/* VERIFIED FIX 2026-07-10-5
   - cuatro invitaciones en una sola fila de escritorio
   - banner centrado y siempre detrás de modales/feedback
   - feedback por encima de cualquier modal
   - etiquetas de Estudio sincronizadas visualmente
*/
:root {
  --z-language-banner: 70;
  --z-main-nav: 100;
  --z-modal-final: 10000;
  --z-feedback-final: 2147483000;
}

/* Banner multilingüe: centrado y sin competir con overlays. */
.top-bar {
  z-index: var(--z-language-banner) !important;
}

.top-bar #language-banner {
  display: block !important;
  width: min(100%, 1200px) !important;
  margin-inline: auto !important;
  padding-inline: 12px;
  text-align: center !important;
  line-height: 1.25;
}

nav {
  z-index: var(--z-main-nav) !important;
}

/* Cuando cualquier modal o menú está activo, la franja desaparece. */
body.modal-open .top-bar,
body.menu-open .top-bar,
body:has(.modal.active) .top-bar,
body:has(.nav-links.active) .top-bar {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Los modales siempre ganan al header y al banner. */
.modal,
#iframe-modal,
#contact-modal {
  z-index: var(--z-modal-final) !important;
}

/* Compatibilidad con los nombres usados por ui-feedback.js y otros overlays. */
body > [data-ui-feedback],
body > [role="alertdialog"],
body > .ui-feedback,
body > .ui-feedback-overlay,
body > .feedback-overlay,
body > .feedback-modal,
body > .success-modal,
body > .error-modal,
body > .toast-container,
body > [class*="ui-feedback"],
body > [class*="feedback-overlay"] {
  position: fixed !important;
  inset: 0 !important;
  z-index: var(--z-feedback-final) !important;
  isolation: isolate !important;
}

/* Las etiquetas breves no heredan estilos que puedan ocultar el cambio de idioma. */
.studio-page .tech-list [data-lang-es][data-lang-en] {
  white-space: normal;
  text-align: center;
}

/* Landing: exactamente cuatro tarjetas en una sola fila de escritorio. */
@media (min-width: 900px) {
  #invitaciones .invitaciones-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: clamp(14px, 1.6vw, 24px) !important;
    width: 100% !important;
    max-width: 1180px !important;
    margin-inline: auto !important;
    padding-inline: 0 !important;
    align-items: start;
  }

  #invitaciones .inv-card {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
  }
}

/* Tablet: dos columnas; móvil: una. */
@media (min-width: 601px) and (max-width: 899px) {
  #invitaciones .invitaciones-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 600px) {
  #invitaciones .invitaciones-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    padding-inline: 12px !important;
  }

  #invitaciones .inv-card {
    width: min(100%, 300px) !important;
  }

  .top-bar #language-banner {
    font-size: 0.5rem !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }
}
