/* Shared navigation for Space Pixel's public pages and explorer. */
.sp-header {
  box-sizing: border-box; position: relative; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  min-height: 86px; height: auto; padding: 14px 140px 14px 4vw;
  border-bottom: 1px solid #ffffff20; background: #050812f2; color: #eef1fa;
  font: 15px/1.4 Arial, sans-serif;
}
.sp-brand {
  display: flex; align-items: center; gap: 12px; flex-shrink: 0;
  color: #eef1fa; text-decoration: none; font-size: 20px; font-weight: 800;
  letter-spacing: 1.7px; white-space: nowrap;
}
.sp-brand b { color: #61e7fa; }
.sp-brand img { display: block; }
.sp-header .sp-nav {
  display: flex; position: static; align-items: center; justify-content: flex-end;
  flex-wrap: wrap; gap: 8px 16px; width: auto; margin: 0; padding: 0;
  color: #b9c7dc; font: 14px/1.4 Arial, sans-serif;
}
.sp-nav a, .sp-nav summary { display: block; color: inherit; text-decoration: none; white-space: nowrap; }
.sp-nav a:hover, .sp-nav a[aria-current], .sp-nav summary:hover,
.sp-explore:has(a[aria-current=page]) summary { color: #67e8fa; }
.sp-header a:focus-visible, .sp-menu-toggle:focus-visible, .sp-nav summary:focus-visible {
  outline: 2px solid #67e8fa; outline-offset: 4px;
}
.sp-menu-toggle {
  display: none; color: #eaf3fc; font: inherit; padding: 10px 14px;
  border: 1px solid #536278; border-radius: 8px; background: #0c1423;
}
.sp-nav .sp-account-link {
  padding: 7px 12px; border: 1px solid #67e8fa7d; border-radius: 8px;
  color: #effbff; background: #142839; font-weight: 700;
}
.sp-nav .sp-account-link:hover { background: #1a3c50; }
.sp-explore { position: relative; }
.sp-explore summary { padding: 8px 1px; cursor: pointer; list-style: none; }
.sp-explore summary::-webkit-details-marker { display: none; }
.sp-explore summary::after {
  content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 3px 3px 8px;
  border-right: 1px solid currentColor; border-bottom: 1px solid currentColor;
  transform: rotate(45deg);
}
.sp-explore[open] summary::after { transform: rotate(225deg); margin-bottom: 0; }
.sp-explore-links {
  position: absolute; top: calc(100% + 6px); left: -12px; min-width: 184px;
  padding: 6px; background: #0c1527; border: 1px solid #43536f;
  border-radius: 9px; box-shadow: 0 12px 34px #0009;
}
.sp-explore-links a { padding: 9px 12px; border-radius: 5px; }
.sp-explore-links a:hover, .sp-explore-links a:focus-visible { background: #182840; }
.explorer .sp-header { position: absolute; inset: 0 0 auto; min-height: 80px; }
.sp-universe-switch { font-size: 12px; margin: 12px 0 0; }
.sp-universe-switch a { color: #adf4da; }
.studio-preview { font-size: 12px; padding: 10px; border: 1px solid #67e8fa66; border-radius: 8px; background: #0d2531; color: #d3f7ff; }
.studio-preview a { display: block; color: #adf4da; margin-top: 5px; }

@media (max-width: 980px) {
  .sp-header { min-height: 76px; padding: 12px 138px 12px 20px; gap: 9px; flex-wrap: wrap; }
  .sp-header .sp-nav { flex-basis: 100%; justify-content: flex-start; }
  .sp-header[data-nav-ready] .sp-menu-toggle { display: block; margin-left: auto; }
  .sp-header[data-nav-ready] .sp-nav {
    display: none; position: absolute; inset: calc(100% + 6px) 14px auto;
    width: auto; max-height: calc(100dvh - 104px); overflow-y: auto; box-sizing: border-box;
    padding: 10px; background: #080e1c; border: 1px solid #435067; border-radius: 12px;
    box-shadow: 0 20px 40px #0009; gap: 0;
  }
  .sp-header[data-nav-ready].sp-menu-open .sp-nav { display: block; }
  .sp-header .sp-nav a, .sp-header .sp-nav summary { padding: 10px 12px; white-space: normal; }
  .sp-nav .sp-account-link { margin: 4px 0 0; }
  .sp-explore-links { position: static; min-width: 0; margin-left: 12px; box-shadow: none; }
  .explorer .sp-header { min-height: 76px; }
  .explorer .navigator, .explorer .deep-controls { top: 98px; }
}
@media (max-width: 600px) {
  .sp-header { padding: 12px 119px 12px 12px; gap: 5px; }
  .sp-brand { font-size: 15px; gap: 6px; letter-spacing: 1px; }
  .sp-brand img { width: 32px; height: 32px; }
  .sp-header[data-nav-ready] .sp-menu-toggle { padding: 6px 8px; font-size: 12px; }
  .sp-menu-toggle span { display: none; }
  .explorer .sp-header { min-height: 84px; }
  .explorer .navigator, .explorer .deep-controls { top: 96px; }
  .explorer .scene-coordinate { top: 142px; }
}

/* Link defaults on the dark site. Explicit component colors still take priority. */
:where(a:link, a:visited) { color: #9aeaf7; }
:where(main p a:any-link, main li a:any-link, main dd a:any-link, main figcaption a:any-link):not([class]) {
  color: #9aeaf7;
  text-underline-offset: .17em;
}
:where(main a:any-link):hover { text-decoration-thickness: 2px; }
:where(main a:any-link, footer a:any-link):focus-visible { outline: 2px solid #9aeaf7; outline-offset: 3px; }
