.nara-entry {
  position: fixed;
  z-index: 40;
  top: clamp(0.35rem, 1.2vh, 0.9rem);
  right: clamp(0.4rem, 1.2vw, 1.25rem);
  width: clamp(145px, 10vw, 190px);
  display: grid;
  justify-items: center;
  gap: 0.15rem;
  opacity: 0;
  transform: rotate(1.6deg) scale(0.97);
  animation: nara-arrives 0.7s steps(4, end) 2.8s forwards;
}

.nara-entry__portal {
  display: block;
  width: 100%;
  cursor: pointer;
  transition: transform 160ms ease, filter 160ms ease;
}

.nara-entry__portal img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 0.2rem rgba(19, 37, 65, 0.24));
}

.nara-entry__portal:hover {
  transform: rotate(-1.6deg) scale(1.035);
  filter: saturate(1.1);
}

.nara-entry__portal:focus-visible,
.site-contact:focus-visible {
  outline: 2px dashed #132541;
  outline-offset: 3px;
}

.site-contact {
  position: fixed;
  z-index: 35;
  right: clamp(0.8rem, 2vw, 2.5rem);
  bottom: clamp(0.65rem, 1.4vh, 1rem);
  color: #132541;
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: clamp(0.75rem, 0.85vw, 0.95rem);
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: 0.025em;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  white-space: nowrap;
  transform: rotate(-1.15deg);
  animation: contact-appears 0.65s steps(4, end) 3.2s both,
    contact-boil 0.55s steps(2, end) 3.85s infinite;
}

.site-contact:hover {
  color: #a52276;
}

.nara-page-fade {
  position: fixed;
  z-index: 9999;
  inset: 0;
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
  background: #000;
  transition: opacity 700ms ease-in;
}

.nara-transitioning .nara-page-fade {
  visibility: visible;
  pointer-events: auto;
  opacity: 1;
}

@keyframes nara-arrives {
  0% {
    opacity: 0;
    transform: rotate(2.6deg) translate(4px, -2px) scale(0.93);
  }
  55% {
    opacity: 0.72;
  }
  100% {
    opacity: 1;
    transform: rotate(1.6deg) translate(0, 0) scale(1);
  }
}

@keyframes contact-appears {
  from {
    opacity: 0;
  }
  to {
    opacity: 0.86;
  }
}

@keyframes contact-boil {
  0%,
  100% {
    transform: rotate(-1.15deg) translate(0, 0);
  }
  50% {
    transform: rotate(-0.85deg) translate(0.35px, -0.25px);
  }
}

@media (max-width: 720px) and (orientation: portrait) {
  .nara-entry {
    top: 0.4rem;
    right: 0.35rem;
    width: clamp(122px, 32vw, 150px);
  }

  .site-contact {
    right: 50%;
    bottom: 0.55rem;
    font-size: 0.75rem;
    transform: translateX(50%) rotate(-1deg);
    animation: contact-appears 0.65s steps(4, end) 3.2s both;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nara-entry {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .nara-entry__portal,
  .site-contact {
    transition: none;
    animation: none;
  }

  .nara-page-fade {
    transition-duration: 120ms;
  }
}
