/* Portal IMI · MITHRIL. Documento propio: los selectores con clase solo
   afectan a esta página, por eso se permite el reset de body.portal. */

:root {
  --bg: #0b1220;
  --texto: #e2e8f0;
  --muted: #94a3b8;
  --acento: #ec4899;
}

body.portal {
  margin: 0;
  padding: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  color: var(--texto);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Contenedor del efecto: es lo que observa el shader para medir su tamaño. */
.portal-lienzo {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
}

/* Fallback permanente: la imagen está siempre; el canvas se pinta encima. */
.portal-fondo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.portal-fondo.oculto {
  visibility: hidden;
}

.halftone-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: pan-y;
}

/* Solo cuando el shader monta se oculta la imagen y se ve el canvas. */
.portal-lienzo.con-shader .portal-fondo {
  visibility: hidden;
}

/* Solo para lectores de pantalla: da jerarquía (h1) sin duplicar el logo. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------ marca */

.portal-marca {
  position: absolute;
  inset: 0;
  /* El canvas se inyecta después en el DOM: sin z-index quedaría encima del logo. */
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 1.5rem;
  text-align: center;
  pointer-events: none;
}

/* Velo suave: garantiza que el logo se lea sobre cualquier zona de la trama. */
.portal-marca::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(78vw, 900px);
  height: min(78vh, 620px);
  border-radius: 50%;
  background: radial-gradient(
    ellipse at center,
    rgba(11, 18, 32, 0.72) 0%,
    rgba(11, 18, 32, 0.45) 42%,
    rgba(11, 18, 32, 0) 72%
  );
  pointer-events: none;
}

.portal-marca > * {
  position: relative;
}

.portal-logo {
  display: block;
  width: clamp(300px, 29vw, 560px);
  height: auto;
  filter: drop-shadow(0 6px 24px rgba(0, 0, 0, 0.55));
}

.portal-lema {
  margin: 0;
  font-size: clamp(0.78rem, 1.1vw, 1rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--texto);
  text-shadow:
    0 1px 3px rgba(6, 10, 18, 0.95),
    0 3px 16px rgba(6, 10, 18, 0.9);
}

.portal-lugar {
  margin: 0;
  font-size: clamp(0.7rem, 0.95vw, 0.86rem);
  letter-spacing: 0.08em;
  color: #cbd5e1;
  text-shadow:
    0 1px 3px rgba(6, 10, 18, 0.95),
    0 3px 16px rgba(6, 10, 18, 0.9);
}

@media (prefers-reduced-motion: reduce) {
  .portal-logo {
    filter: none;
  }
}

@media (max-width: 640px) {
  .portal-logo {
    width: min(62vw, 300px);
  }
}
