/* Antonio Aguilar — hoja de estilos principal */

:root {
  --ink:        #070b14;
  --ink-soft:   #0d1422;
  --text:       #eef3fb;
  --text-dim:   #9fb0c9;
  --azul:       #4da2ff;
  --azul-claro: #a7d2ff;
  --oro:        #f0a92a;
  --borde:      rgba(167, 210, 255, .18);

  --fuente: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
            "Helvetica Neue", Arial, sans-serif;
  --gutter: 20px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--ink);
  color: var(--text);
  font-family: var(--fuente);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- Portada ---------- */

.portal {
  position: relative;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: 1fr auto;
  overflow: hidden;
  isolation: isolate;
}

.portal__media {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.portal__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  animation: emerge 1.6s cubic-bezier(.22, 1, .36, 1) both;
}

/* Velo inferior: oscurece solo la zona del texto y deja el anillo limpio */
.portal__veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to bottom,
      rgba(7, 11, 20, .55) 0%,
      rgba(7, 11, 20, 0)   28%,
      rgba(7, 11, 20, 0)   48%,
      rgba(7, 11, 20, .72) 82%,
      rgba(7, 11, 20, .94) 100%);
}

.portal__content {
  align-self: end;
  text-align: center;
  padding: 0 var(--gutter) clamp(28px, 6vh, 64px);
  animation: rise 1.1s cubic-bezier(.22, 1, .36, 1) .35s both;
}

.portal__name {
  margin: 0;
  font-size: clamp(2rem, 7.5vw, 4.25rem);
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 2px 28px rgba(7, 11, 20, .85);
}

.portal__tagline {
  margin: .55em 0 0;
  font-size: clamp(.95rem, 2.4vw, 1.2rem);
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--oro);
  text-shadow: 0 2px 18px rgba(7, 11, 20, .9);
}

.portal__note {
  margin: 1.1em auto 0;
  max-width: 52ch;
  font-size: clamp(.88rem, 2vw, 1rem);
  color: var(--text-dim);
  text-shadow: 0 2px 14px rgba(7, 11, 20, .9);
}

.portal__footer {
  padding: 0 var(--gutter) clamp(18px, 3vh, 30px);
  text-align: center;
  animation: rise 1.1s cubic-bezier(.22, 1, .36, 1) .6s both;
}

.portal__status {
  display: inline-flex;
  align-items: center;
  gap: .55em;
  margin: 0;
  padding: .45em 1.1em;
  border: 1px solid var(--borde);
  border-radius: 999px;
  background: rgba(13, 20, 34, .55);
  backdrop-filter: blur(6px);
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.dot {
  width: .5em;
  height: .5em;
  border-radius: 50%;
  background: var(--azul);
  box-shadow: 0 0 0 0 rgba(77, 162, 255, .6);
  animation: pulse 2.6s ease-out infinite;
}

/* ---------- 404 ---------- */

.lost {
  min-height: 100dvh;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: .4rem;
  padding: 48px var(--gutter);
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(77, 162, 255, .12), transparent 62%),
    var(--ink);
}

.lost__code {
  margin: 0;
  font-size: clamp(3.5rem, 16vw, 7rem);
  font-weight: 700;
  line-height: 1;
  color: var(--azul);
  letter-spacing: .04em;
}

.lost__title {
  margin: .3em 0 0;
  font-size: clamp(1.15rem, 4vw, 1.6rem);
  font-weight: 600;
}

.lost__text { margin: .5em 0 1.8em; color: var(--text-dim); }

.lost__link {
  display: inline-block;
  padding: .75em 1.8em;
  border: 1px solid var(--oro);
  border-radius: 999px;
  color: var(--oro);
  text-decoration: none;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: .82rem;
  transition: background-color .25s ease, color .25s ease;
}

.lost__link:hover,
.lost__link:focus-visible {
  background: var(--oro);
  color: var(--ink);
}

/* ---------- Animaciones ---------- */

@keyframes emerge {
  from { opacity: 0; transform: scale(1.06); }
  to   { opacity: 1; transform: scale(1); }
}

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

@keyframes pulse {
  0%        { box-shadow: 0 0 0 0 rgba(77, 162, 255, .55); }
  70%, 100% { box-shadow: 0 0 0 .7em rgba(77, 162, 255, 0); }
}

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

/* En pantallas muy apaisadas el anillo queda alto: se recentra */
@media (min-aspect-ratio: 16/10) {
  .portal__media img { object-position: center 46%; }
}

/* ---------- Pantallas estrechas ----------
   A pantalla completa, "cover" ampliaria tanto la imagen que el portal
   se saldria del encuadre. En movil la imagen pasa a ocupar la franja
   superior con su proporcion real y el texto cae debajo, sobre el fondo. */

@media (max-width: 760px), (max-aspect-ratio: 4/5) {
  .portal {
    grid-template-rows: auto 1fr auto;
    background:
      radial-gradient(ellipse 120% 50% at 50% 18%, rgba(77, 162, 255, .16), transparent 70%),
      var(--ink);
  }

  .portal__media {
    position: relative;
    inset: auto;
    z-index: 0;
  }

  .portal__media img {
    height: auto;
    aspect-ratio: 1 / 1;
    object-position: center 45%;
  }

  /* Funde el borde inferior de la imagen con el fondo */
  .portal__media::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 30%;
    background: linear-gradient(to bottom, rgba(7, 11, 20, 0), var(--ink) 94%);
    pointer-events: none;
  }

  .portal__veil { display: none; }

  .portal__content {
    align-self: center;
    position: relative;
    z-index: 1;
    padding-bottom: 24px;
  }

  .portal__name {
    font-size: clamp(1.6rem, 7.2vw, 2.4rem);
    letter-spacing: .04em;
  }

  .portal__tagline { letter-spacing: .22em; }

  .portal__footer { padding-bottom: 26px; }
}

:focus-visible {
  outline: 2px solid var(--azul-claro);
  outline-offset: 3px;
}
