@view-transition {
  navigation: auto;
}
.nav-app-link {
  position: relative;
  transition:
    transform 180ms ease,
    filter 180ms ease;
  touch-action: manipulation;
}
.nav-app-link::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 2px solid #ccff00;
  border-radius: 5px;
  opacity: 0;
  pointer-events: none;
}
.nav-app-link.pi-app-pressed {
  transform: scale(0.97);
  filter: brightness(1.25);
}
.nav-app-link.pi-app-pressed::after {
  animation: pi-app-impulse 220ms ease-out both;
}
body.pi-portal-departure > header,
body.pi-portal-departure > main,
body.pi-portal-departure > section,
body.pi-portal-departure > footer {
  animation: pi-site-recede 260ms ease-out both;
  transform-origin: center 25%;
}
#pi-app-portal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  overflow: hidden;
  animation: pi-portal-clear 1100ms linear both;
}
.pi-portal-opening {
  position: absolute;
  width: 160vmax;
  height: 160vmax;
  left: calc(var(--portal-x) - 80vmax);
  top: calc(var(--portal-y) - 80vmax);
  border-radius: 50%;
  border: 1px solid #ccff00;
  background: radial-gradient(ellipse at center, #10150d, #0a0a0af2 70%);
  transform: scale(0);
  animation: pi-portal-open 300ms cubic-bezier(0.2, 0.65, 0.2, 1) both;
}
.pi-portal-court {
  position: absolute;
  inset: 30% -20% -50%;
  border: 1px solid #ccff0055;
  background:
    linear-gradient(90deg, transparent 49.9%, #ccff0044 50%, transparent 50.1%),
    linear-gradient(transparent 49.8%, #ccff0044 50%, transparent 50.2%);
  transform: perspective(500px) rotateX(62deg);
  opacity: 0;
  animation: pi-court-light 260ms ease-out both;
}
@keyframes pi-app-impulse {
  0% {
    opacity: 1;
    clip-path: inset(0 100% 0 0);
  }
  60% {
    opacity: 1;
    clip-path: inset(0);
  }
  100% {
    opacity: 0;
    clip-path: inset(0);
  }
}
@keyframes pi-site-recede {
  to {
    opacity: 0.45;
    transform: scale(0.98);
  }
}
@keyframes pi-portal-open {
  to {
    transform: scale(1);
  }
}
@keyframes pi-court-light {
  to {
    opacity: 0.6;
    transform: perspective(500px) rotateX(48deg);
  }
}
@keyframes pi-portal-clear {
  0%,
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
::view-transition-old(root) {
  animation: pi-site-away 180ms ease-out both;
}
@keyframes pi-site-away {
  to {
    opacity: 0;
    transform: scale(0.985);
  }
}
@media (prefers-reduced-motion: reduce) {
  #pi-app-portal {
    display: none;
  }
  .nav-app-link,
  .nav-app-link::after,
  body.pi-portal-departure > * {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}

/* Same navigation geometry for the enabled APP notice button. */
button.nav-app-link { appearance:none; border:0; background:transparent; color:inherit; padding:0; cursor:pointer; display:flex; align-items:center; min-height:44px; font:italic 900 19px/1 var(--display, sans-serif); text-transform:uppercase; }
.nav-links button.nav-app-link { font-size:clamp(16px,1.45vw,23px); }
button.nav-app-link:hover { color:var(--lime,#ccff00); }
button.nav-app-link:focus-visible,.pi-app-notice button:focus-visible { outline:2px solid #ccff00; outline-offset:5px; }
.pi-app-notice { box-sizing:border-box; width:min(440px,calc(100% - 36px)); color:#f5f3e8; background:#071421; border:1px solid #00d9e8; border-radius:16px; padding:32px; box-shadow:0 0 30px #00d9e833; text-align:center; animation:pi-notice-in 150ms ease-out; }
.pi-app-notice::backdrop { background:#000b; }
.pi-app-notice p { font:italic 900 clamp(26px,5vw,38px)/1.15 var(--display,sans-serif); margin:0 0 24px; }
.pi-app-notice-close { min-height:44px; padding:8px 24px; border:1px solid #ccff00; border-radius:6px; background:transparent; color:#ccff00; font:inherit; cursor:pointer; }
@keyframes pi-notice-in { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }
@media(max-width:760px) { .nav .nav-links button.nav-app-link { font-size:22px; } }
@media(prefers-reduced-motion:reduce) { .pi-app-notice { animation:none; } }
