.page-villa-network {
  --experience-footer-height: var(--site-footer-height);
}

.cosmic-experience-layer {
  position: fixed;
  inset: 0;
  z-index: 5;
  min-height: calc(100dvh - var(--experience-footer-height));
  height: calc(100dvh - var(--experience-footer-height));
  inset-block-end: var(--experience-footer-height);
}

.cosmic-experience-layer[hidden],
.globe-container[hidden],
.network-hud[hidden] {
  display: none;
}

.cosmic-fallback-actions {
  position: absolute;
  z-index: 6;
  inset: auto auto max(0.5rem, env(safe-area-inset-bottom)) max(0.5rem, env(safe-area-inset-left));
  display: flex;
  width: 1px;
  height: 1px;
  overflow: hidden;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  padding: 0;
  clip-path: inset(50%);
  white-space: nowrap;
}

.cosmic-fallback-actions:is(:focus-within, .is-recovery) {
  width: min(30rem, calc(100% - 2rem));
  height: auto;
  overflow: visible;
  padding: 0.75rem;
  clip-path: none;
  white-space: normal;
  background: rgba(3, 1, 8, 0.9);
  backdrop-filter: blur(8px);
}

.cosmic-fallback-actions[hidden] { display: none; }

.cosmic-fallback-actions a {
  align-items: center;
  text-decoration: none;
}

.is-handoff-revealing .cosmic-experience-layer {
  background: transparent;
  opacity: 0.92;
  transition: background 420ms ease-out, opacity 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.page-villa-network .globe-container {
  opacity: 1;
  transform: scale(1);
  transition: opacity 480ms cubic-bezier(0.22, 1, 0.36, 1), transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.page-villa-network.is-handoff-revealing .globe-container {
  opacity: 0.16;
  transform: scale(1.018);
}

.page-villa-network > main {
  width: 100%;
  min-height: calc(100svh - var(--experience-footer-height));
}

.page-villa-network .nav-links a {
  position: relative;
  transition: color 180ms ease, text-shadow 180ms ease;
}

.page-villa-network .nav-links a::after {
  position: absolute;
  inset: auto 50% 0.35rem;
  width: 0;
  height: 1px;
  background: var(--experience-active-origin);
  content: "";
  transition: width 180ms ease, inset-inline-start 180ms ease;
}

.page-villa-network .nav-links a:is(:hover, :focus-visible) {
  color: var(--experience-starlight);
  text-shadow: 0 0 0.45rem rgba(248, 250, 252, 0.45), 0 0 0.9rem var(--experience-hidden-network);
}

.page-villa-network .nav-links a.active { color: var(--experience-active-origin); }

.page-villa-network .nav-links a:is(:hover, :focus-visible, .active)::after {
  inset-inline-start: 15%;
  width: 70%;
}

.villa-experience-footer {
  position: fixed !important;
  inset: auto 0 0;
  z-index: 20;
  display: flex;
  min-height: var(--experience-footer-height);
  justify-content: center;
  gap: 1rem;
  border-top: 1px solid var(--experience-hidden-network-soft);
}

.villa-experience-footer .villa-footer-copyright {
  margin-inline: auto;
  text-align: center;
}

.villa-experience-footer > p {
  width: auto;
  flex: 0 1 auto;
  white-space: normal;
}

.villa-experience-footer .map-attribution-bar {
  position: absolute;
  inset: auto var(--site-page-gutter) auto auto;
  padding: 0;
  background: transparent;
}

@media (max-width: 600px) {
  .page-villa-network { --experience-footer-height: 54px; }

  .cosmic-fallback-actions {
    inset-inline: 0.5rem auto;
    flex-direction: column;
  }

  .cosmic-fallback-actions:is(:focus-within, .is-recovery) {
    inset-inline: 0.75rem;
    width: auto;
  }

  .villa-experience-footer {
    flex-direction: column;
    gap: 0.4rem;
    padding-block: 0.3rem;
  }

  .villa-experience-footer .map-attribution-bar {
    position: static;
    inset: auto;
    text-align: center;
  }

  .villa-experience-footer > p {
    font-size: 0.62rem !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .is-handoff-revealing .cosmic-experience-layer { transition: none; }
}
