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

  @font-face {
    font-family: 'Inter';
    src: local('Inter');
  }

  html, body {
    width: 100%;
    height: 100%;
    background: #000000;
    overflow: hidden;
    font-family: 'Inter', -apple-system, 'Helvetica Neue', Arial, sans-serif;
  }

  #canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }

  canvas {
    display: block;
    cursor: none;
  }

  #cursor-dot.hovering {
    width: 14px;
    height: 14px;
    background: transparent;
    border: 1.5px solid #EAEAEA;
  }

  /* Pista visual al pasar el ratón por el mercurio — indica que es
     clicable, para quien no lo intente por instinto */
  #hover-hint {
    position: fixed;
    pointer-events: none;
    z-index: 101;
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #EAEAEA;
    background: rgba(0,0,0,0.6);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(234,234,234,0.25);
    opacity: 0;
    transform: translate(-50%, 24px);
    transition: opacity 0.3s ease;
    white-space: nowrap;
  }

  #hover-hint.visible {
    opacity: 1;
  }
  #cursor-dot {
    position: fixed;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #EAEAEA;
    pointer-events: none;
    z-index: 100;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease, opacity 0.3s ease;
    opacity: 0.8;
  }

  /* Navegación */
  nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 40px 64px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 40px;
    z-index: 10;
    opacity: 0;
    animation: fadeInDown 1.6s ease 0.3s forwards;
  }

  .logo-nav {
    font-size: 19px;
    font-weight: 400;
    letter-spacing: 6px;
    color: #EAEAEA;
    flex-shrink: 0;
    margin-right: auto;
  }

  .nav-links {
    display: flex;
    gap: 32px;
    flex-wrap: nowrap;
    flex-shrink: 0;
  }

  .nav-links a {
    white-space: nowrap;
  }

  .nav-links a {
    color: rgba(234,234,234,0.6);
    text-decoration: none;
    font-size: 13px;
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: color 0.4s ease;
    position: relative;
  }

  .nav-links a::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 1px;
    background: #EAEAEA;
    transition: width 0.4s ease;
  }

  .nav-links a:hover {
    color: #EAEAEA;
  }

  .nav-links a:hover::after {
    width: 100%;
  }

  /* Hero text */
  .hero-content {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 90px;
    z-index: 5;
    pointer-events: none;
  }

  .eyebrow {
    font-size: 12px;
    font-weight: 300;
    letter-spacing: 5px;
    color: rgba(234,234,234,0.4);
    text-transform: uppercase;
    margin-bottom: 22px;
    opacity: 0;
    animation: fadeIn 1.8s ease 1.4s forwards;
  }

  .tagline {
    font-size: 15px;
    font-weight: 200;
    letter-spacing: 3px;
    color: rgba(234,234,234,0.75);
    opacity: 0;
    animation: fadeIn 1.8s ease 1.7s forwards;
  }

  .scroll-hint {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    letter-spacing: 3px;
    color: rgba(234,234,234,0.3);
    text-transform: uppercase;
    z-index: 10;
    opacity: 0;
    animation: fadeIn 1.8s ease 2.2s forwards;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .scroll-line {
    width: 1px;
    height: 32px;
    background: linear-gradient(to bottom, rgba(234,234,234,0.5), transparent);
    animation: scrollPulse 2.4s ease-in-out infinite;
  }

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

  @keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-16px); }
    to { opacity: 1; transform: translateY(0); }
  }

  @keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.7); }
    50% { opacity: 1; transform: scaleY(1); }
  }

  .loading {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #000;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 1s ease;
  }

  .loading span {
    color: rgba(234,234,234,0.4);
    font-size: 11px;
    letter-spacing: 4px;
    text-transform: uppercase;
  }

  /* Flash de transición del portal — cubre la pantalla brevemente
     mientras la cámara "atraviesa" el aro, ocultando el corte técnico */
  #portal-flash {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: #EAEAEA;
    opacity: 0;
    pointer-events: none;
    z-index: 50;
  }

  /* Vista "dentro del universo NEXK" — placeholder de scroll,
     se revela tras la transición de portal */
  #inside-view {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    overflow-y: scroll;
    overflow-x: hidden;
    z-index: 20;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1.2s ease;
  }

  #inside-view.active {
    pointer-events: auto;
  }

  /* Este div solo existe para generar altura de scroll — el usuario
     nunca ve su contenido, solo aporta la barra de desplazamiento que
     controla la posición de la cámara 3D (leemos su scrollTop) */
  #scroll-driver {
    width: 100%;
    height: 280vh;
  }

  /* Las secciones ahora son overlays fijos superpuestos al canvas 3D,
     no bloques apilados — su opacidad la controla JS según la posición
     de la cámara en el recorrido, no el scroll nativo del navegador */
  .inside-section {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    opacity: 0;
    pointer-events: none;
  }

  .inside-section .label {
    font-size: 11px;
    letter-spacing: 4px;
    color: rgba(234,234,234,0.4);
    text-transform: uppercase;
    margin-bottom: 24px;
  }

  .inside-section h2 {
    font-size: 42px;
    font-weight: 200;
    letter-spacing: 1px;
    color: #EAEAEA;
    margin-bottom: 16px;
    text-align: center;
  }

  .inside-section p {
    font-size: 15px;
    font-weight: 300;
    color: rgba(234,234,234,0.55);
    max-width: 480px;
    text-align: center;
    line-height: 1.7;
  }

  .placeholder-tag {
    margin-top: 28px;
    font-size: 10px;
    letter-spacing: 2px;
    color: rgba(234,234,234,0.3);
    border: 1px solid rgba(234,234,234,0.15);
    padding: 6px 14px;
    border-radius: 20px;
    text-transform: uppercase;
  }

  #back-to-hero {
    position: fixed;
    top: 40px;
    left: 56px;
    z-index: 45;
    font-size: 13px;
    letter-spacing: 2px;
    color: rgba(234,234,234,0.6);
    text-decoration: none;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease, color 0.3s ease;
  }

  #back-to-hero.active {
    opacity: 1;
    pointer-events: auto;
  }

  #back-to-hero:hover {
    color: #EAEAEA;
  }

  /* Indicador de progreso del recorrido — muestra en qué "destino"
     del universo NEXK está la cámara ahora mismo */
  #journey-nav {
    position: fixed;
    right: 48px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 25;
    display: flex;
    flex-direction: column;
    gap: 18px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease;
  }

  #journey-nav.active {
    pointer-events: auto;
    opacity: 1;
  }

  .journey-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(234,234,234,0.25);
    transition: background 0.4s ease, transform 0.4s ease;
  }

  .journey-dot.current {
    background: #EAEAEA;
    transform: scale(1.6);
  }

  /* Fuerza ocultar el nav mientras se está dentro del portal.
     Necesario con !important porque la animación fadeInDown del nav
     (con fill-mode forwards) tiene más prioridad que un cambio de
     opacidad hecho desde JS con estilo inline — sin esto, el "NEXK"
     del nav se queda visible tapando el botón "Back". */
  body.inside-portal nav,
  body.inside-portal .hero-content,
  body.inside-portal .scroll-hint {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.4s ease;
  }

  /* Vista independiente de Marketing — NO forma parte del recorrido
     del mercurio. Se abre directamente al hacer click en el menú,
     por eso necesita su propio fondo, cierre y z-index, sin depender
     del estado del portal 3D en absoluto. */
  #marketing-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: #000000;
    z-index: 60;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
  }

  #marketing-overlay.active {
    opacity: 1;
    pointer-events: auto;
  }

  #marketing-overlay .label {
    font-size: 11px;
    letter-spacing: 4px;
    color: rgba(234,234,234,0.4);
    text-transform: uppercase;
    margin-bottom: 24px;
  }

  #marketing-overlay h2 {
    font-size: 42px;
    font-weight: 200;
    color: #EAEAEA;
    margin-bottom: 16px;
    text-align: center;
  }

  #marketing-overlay p {
    font-size: 15px;
    font-weight: 300;
    color: rgba(234,234,234,0.55);
    max-width: 480px;
    text-align: center;
    line-height: 1.7;
  }

  #marketing-close {
    position: fixed;
    top: 40px;
    left: 56px;
    font-size: 13px;
    letter-spacing: 2px;
    color: rgba(234,234,234,0.6);
    text-decoration: none;
    transition: color 0.3s ease;
  }

  #marketing-close:hover {
    color: #EAEAEA;
  }

  /* Caja de error visible — normalmente invisible (display:none),
     solo aparece si el JavaScript falla de verdad */
  #error-overlay {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    max-width: 600px;
    margin: 0 auto;
    background: #4a0000;
    color: #ffdddd;
    border: 2px solid #ff4444;
    border-radius: 6px;
    padding: 20px;
    font-family: monospace;
    font-size: 13px;
    line-height: 1.6;
    z-index: 9999;
  }

  /* Carrusel de selección — aparece al entrar al portal, permite elegir
     directamente a qué sección ir, sin depender del scroll */
  #portal-carousel {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 40;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease;
    gap: 40px;
  }

  #portal-carousel.active {
    opacity: 1;
    pointer-events: auto;
  }

  .carousel-title {
    font-size: 13px;
    font-weight: 300;
    letter-spacing: 3px;
    color: rgba(234,234,234,0.45);
    text-transform: uppercase;
  }

  .carousel-options {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 800px;
    padding: 0 40px;
  }

  .carousel-option {
    background: transparent;
    border: 1px solid rgba(234,234,234,0.25);
    color: #EAEAEA;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 300;
    letter-spacing: 1px;
    padding: 16px 28px;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.3s ease, background 0.3s ease, transform 0.3s ease;
  }

  .carousel-option:hover {
    border-color: rgba(234,234,234,0.7);
    background: rgba(234,234,234,0.06);
    transform: translateY(-2px);
  }

  @media (max-width: 768px) {
    .carousel-options { gap: 10px; }
    .carousel-option { padding: 12px 20px; font-size: 13px; }
  }

  @media (max-width: 768px) {
    nav { padding: 28px 24px; }
    .nav-links { gap: 24px; }
    .nav-links a { font-size: 11px; }
    .logo-nav { font-size: 16px; letter-spacing: 4px; }
    .eyebrow { font-size: 10px; letter-spacing: 3px; }
    .tagline { font-size: 13px; }
  }

  /* ------------------------------------------------------------
     Tarjetas de contenido dentro de cada parada del recorrido 3D.
     Los datos vienen de js/content.js — no tocar esto para añadir
     proyectos, solo para ajustar el ESTILO de las tarjetas.
     ------------------------------------------------------------ */
  .cards-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    max-width: 900px;
    margin-top: 32px;
  }

  .content-card {
    background: rgba(234,234,234,0.03);
    border: 1px solid rgba(234,234,234,0.12);
    border-radius: 4px;
    padding: 22px 24px;
    width: 260px;
    text-align: left;
    text-decoration: none;
    transition: border-color 0.4s ease, background 0.4s ease, transform 0.4s ease;
  }

  .content-card:hover {
    border-color: rgba(234,234,234,0.4);
    background: rgba(234,234,234,0.06);
    transform: translateY(-4px);
  }

  .content-card .card-title {
    font-size: 15px;
    font-weight: 400;
    color: #EAEAEA;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
  }

  .content-card .card-desc {
    font-size: 12px;
    font-weight: 300;
    color: rgba(234,234,234,0.5);
    line-height: 1.5;
  }

  .content-card .card-category {
    display: inline-block;
    font-size: 9px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(234,234,234,0.35);
    margin-bottom: 10px;
  }

  @media (max-width: 768px) {
    .content-card { width: 100%; max-width: 320px; }
    .inside-section h2 { font-size: 28px; }
  }
