/* ═══════════════════════════════════════════
   NEXUS — Login + command deck on the starship bridge
   ═══════════════════════════════════════════ */

.topbar .auth-chip {
  margin-left: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.6rem;
  padding: 0.55rem 1.1rem;
  font-family: var(--font-display);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: 2px;
  border: 1px solid var(--border);
  cursor: pointer;
}

.btn--primary {
  color: #041018;
  background: linear-gradient(135deg, #7ef0ff 0%, #3de0ff 40%, #2b9bff 100%);
  border-color: rgba(255, 255, 255, 0.35);
}

.btn--ghost {
  color: var(--text);
  background: rgba(4, 14, 32, 0.45);
}

.btn--ghost:hover {
  border-color: var(--border-bright);
}

.auth-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 1.85rem;
  padding: 0.3rem 0.7rem;
  font-family: var(--font-display);
  font-size: 0.5rem;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 2px;
  background: rgba(4, 14, 32, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.auth-chip:hover,
.auth-chip:focus-visible {
  color: var(--cyan);
  border-color: var(--border-bright);
}

.auth-chip-led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-dim);
}

body.is-auth .auth-chip-led {
  background: #3dff9a;
  box-shadow: 0 0 8px rgba(61, 255, 154, 0.7);
}

.subtitle .sub-pipe {
  margin: 0 0.28em;
  color: var(--cyan);
  opacity: 0.75;
}

.lead {
  max-width: 36rem;
  margin: 0.85rem auto 0;
  font-size: 0.95rem;
  font-weight: 300;
  line-height: 1.55;
  color: var(--text-muted);
  text-align: center;
}

.deck-empty {
  padding: 1rem 0.75rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  list-style: none;
}

/* After enter: keep the live bridge, hide placeholder sections */
body.is-bridge {
  overflow: hidden;
  height: 100vh;
}

body.is-bridge .panel.section,
body.is-bridge .footer {
  display: none;
}

body.is-bridge .hero {
  min-height: auto;
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}

body.is-bridge .title {
  font-size: clamp(1.8rem, 5vw, 3.4rem);
}

body.is-bridge .cards {
  display: none;
}

/* Shared HUD chrome (mirrors the media player) */
.hud-panel {
  position: fixed;
  z-index: 55;
  color: var(--text);
  opacity: 0;
  transform: translateY(12px);
  filter: blur(4px);
  pointer-events: none;
}

.hud-panel.is-online {
  opacity: 1;
  transform: none;
  filter: none;
  pointer-events: auto;
  transition:
    opacity 0.8s var(--ease-soft),
    transform 0.8s var(--ease-soft),
    filter 0.8s var(--ease-soft);
}

.hud-panel.is-closing {
  pointer-events: none;
}

.hud-panel[hidden] {
  display: none !important;
}

.hud-chrome {
  background: linear-gradient(
    165deg,
    rgba(4, 12, 28, 0.52) 0%,
    rgba(2, 6, 16, 0.58) 100%
  );
  border: 1px solid rgba(61, 224, 255, 0.22);
  border-radius: 3px;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.28),
    0 12px 32px rgba(0, 0, 0, 0.32),
    0 0 28px rgba(43, 155, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
}

.hud-chrome::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan) 30%, var(--cyan) 70%, transparent);
  opacity: 0.5;
}

.hud-chrome {
  position: relative;
}

.hud-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.65rem 0.8rem 0.5rem;
  border-bottom: 1px solid rgba(61, 224, 255, 0.1);
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.hud-head:active,
.hud-panel.is-dragging .hud-head {
  cursor: grabbing;
}

.hud-panel.is-dragging {
  transition: none !important;
  animation: none !important;
  opacity: 1 !important;
  filter: none !important;
  cursor: grabbing;
  user-select: none;
  z-index: 90;
}

.hud-panel.is-dragged {
  right: auto;
  bottom: auto;
  transform: none !important;
}

.hud-id {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.hud-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
}

.hud-led.is-live,
body.is-auth .hud-login .hud-led {
  background: #3dff9a;
  box-shadow: 0 0 10px rgba(61, 255, 154, 0.7);
}

.hud-sys {
  font-family: var(--font-display);
  font-size: 0.46rem;
  letter-spacing: 0.14em;
  color: var(--text-dim);
}

.hud-mode {
  font-family: var(--font-display);
  font-size: 0.56rem;
  letter-spacing: 0.12em;
  color: var(--cyan);
  margin-top: 0.12rem;
}

.hud-hint {
  font-size: 0.78rem;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 0.7rem;
}

.hud-field {
  display: grid;
  gap: 0.28rem;
  margin-bottom: 0.65rem;
  text-align: left;
}

.hud-field > span {
  font-family: var(--font-display);
  font-size: 0.46rem;
  letter-spacing: 0.16em;
  color: var(--text-dim);
}

.hud-field input,
.hud-field textarea,
.hud-field select {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: rgba(0, 8, 20, 0.55);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.5rem 0.6rem;
  outline: none;
}

.hud-field textarea {
  resize: vertical;
  min-height: 3.4rem;
}

.hud-field input:focus,
.hud-field textarea:focus,
.hud-field select:focus {
  border-color: var(--border-bright);
  box-shadow: 0 0 0 1px rgba(61, 224, 255, 0.2);
}

.hud-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Login — stacks under the music player, top-right */
.hud-login {
  top: calc(clamp(4.5rem, 10vh, 5.5rem) + 17.75rem);
  right: clamp(0.75rem, 2vw, 1.5rem);
  left: auto;
  width: min(420px, calc(100vw - 1.5rem));
}

.login-form {
  padding: 0.85rem 0.9rem 1rem;
}

.login-submit {
  width: 100%;
  margin-top: 0.25rem;
}

.login-error {
  color: #ff8a9b;
  font-size: 0.78rem;
  margin: -0.2rem 0 0.6rem;
}

/* Projects — three-realm grid */
.hud-projects {
  left: 50%;
  transform: translate(-50%, 12px);
  bottom: 3.4rem;
  width: min(1080px, calc(100vw - 1.5rem));
  z-index: 57;
}

.hud-projects.is-online {
  transform: translate(-50%, 0);
}

.realm-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  padding: 0.75rem 0.85rem 0.95rem;
}

.realm-col {
  text-align: left;
  padding: 0.7rem 0.75rem 0.8rem;
  border: 1px solid rgba(61, 224, 255, 0.16);
  border-radius: 2px;
  background: rgba(4, 14, 32, 0.18);
  min-height: 12rem;
}

.realm-col[data-realm="virtual"] {
  border-color: rgba(120, 200, 255, 0.28);
}

.realm-col[data-realm="augmented"] {
  border-color: rgba(61, 224, 255, 0.32);
}

.realm-col[data-realm="real"] {
  border-color: rgba(61, 255, 154, 0.28);
}

.realm-head {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.realm-key {
  font-family: var(--font-display);
  font-size: 0.42rem;
  letter-spacing: 0.14em;
  color: var(--cyan);
}

.realm-head h3 {
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.realm-lead {
  font-size: 0.78rem;
  font-weight: 300;
  line-height: 1.4;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
}

.realm-list {
  list-style: none;
  display: grid;
  gap: 0.4rem;
}

.realm-list li {
  font-size: 0.76rem;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.35;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(61, 224, 255, 0.08);
}

.realm-list span {
  display: block;
  font-family: var(--font-display);
  font-size: 0.44rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 0.12rem;
}

.hud-memory-panel {
  left: 50%;
  transform: translate(-50%, 12px);
  bottom: 3.4rem;
  width: min(560px, calc(100vw - 1.5rem));
  z-index: 57;
}

.hud-memory-panel.is-online {
  transform: translate(-50%, 0);
}

.memory-hud-list {
  list-style: none;
  display: grid;
  gap: 0.45rem;
  padding: 0.75rem 0.85rem 0.95rem;
  max-height: 36vh;
  overflow: auto;
}

.memory-hud-list li {
  text-align: left;
  padding: 0.55rem 0.6rem;
  border: 1px solid rgba(61, 224, 255, 0.12);
  background: rgba(4, 14, 32, 0.16);
}

.memory-hud-list strong {
  display: block;
  font-size: 0.86rem;
  font-weight: 500;
}

.memory-hud-list p {
  margin-top: 0.2rem;
  font-size: 0.76rem;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.4;
}

.nav-link--auth {
  display: none;
}

body.is-auth .nav-link--auth {
  display: inline-flex;
}

/* About — manifesto HUD with 3D ship in the bottom-right corner */
.hud-about {
  top: clamp(4.6rem, 10vh, 5.6rem);
  left: 50%;
  transform: translate(-50%, 12px);
  width: min(860px, calc(100vw - 1.5rem));
  z-index: 64;
}

.hud-about.is-online {
  transform: translate(-50%, 0);
}

.hud-chrome--about {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: min(78vh, 680px);
}

.about-body {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(220px, 0.9fr);
  align-items: stretch;
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 0.9rem 0.35rem 0.35rem 1rem;
}

.about-copy {
  position: relative;
  z-index: 1;
  padding: 0 0.6rem 0.85rem 0;
  text-align: left;
}

.about-kicker {
  font-family: var(--font-display);
  font-size: 0.46rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 0.45rem;
}

.about-title {
  font-family: var(--font-display);
  font-size: clamp(0.92rem, 1.6vw, 1.15rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.3;
  color: var(--text);
  margin: 0 0 0.7rem;
}

.about-lead,
.about-text,
.about-close {
  font-size: 0.86rem;
  font-weight: 300;
  line-height: 1.55;
  color: var(--text-muted);
}

.about-lead {
  margin-bottom: 0.55rem;
}

.about-text {
  margin-bottom: 0.75rem;
}

.about-pillars {
  list-style: none;
  display: grid;
  gap: 0.38rem;
  margin: 0 0 0.85rem;
  padding: 0;
}

.about-pillars li {
  display: grid;
  grid-template-columns: 7.2rem 1fr;
  gap: 0.55rem;
  align-items: baseline;
  padding: 0.32rem 0.45rem;
  border: 1px solid rgba(61, 224, 255, 0.12);
  border-radius: 2px;
  background: rgba(4, 14, 32, 0.16);
}

.about-pillar-key {
  font-family: var(--font-display);
  font-size: 0.46rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
}

.about-pillars span:last-child {
  font-size: 0.78rem;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.4;
}

.about-close {
  margin: 0;
}

.about-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.2rem;
  min-width: 0;
}

.about-avatar {
  width: min(42%, 148px);
  height: auto;
  filter: drop-shadow(0 0 18px rgba(61, 224, 255, 0.35));
  user-select: none;
  pointer-events: none;
}

.about-ship {
  position: relative;
  width: min(100%, 420px);
  margin: 0 -0.2rem -1.15rem 0;
  pointer-events: none;
  z-index: 0;
}

.about-ship-img {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0.96;
  filter: drop-shadow(0 0 22px rgba(61, 224, 255, 0.22));
  user-select: none;
}

.hud-systems {
  left: clamp(0.75rem, 2vw, 1.5rem);
  bottom: 1rem;
  width: min(446px, calc(100vw - 1.5rem));
  z-index: 56;
}

.hud-chrome--systems {
  overflow: hidden;
}

.systems-body {
  padding: 0.55rem 0.65rem 0.7rem;
}

.systems-ship {
  position: relative;
  margin-bottom: 0.45rem;
}

.systems-ship-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1792 / 1008;
}

.systems-shield,
.systems-ship-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.systems-ship-img {
  object-fit: contain;
  user-select: none;
  filter: drop-shadow(0 0 10px rgba(61, 224, 255, 0.2));
}

.systems-shield {
  overflow: visible;
}

.systems-shield-glow {
  fill: rgba(210, 240, 255, 0.035);
  stroke: none;
  animation: shield-breathe 2.8s ease-in-out infinite;
}

.systems-shield-ring {
  fill: none;
  stroke: rgba(210, 240, 255, 0.22);
  stroke-width: 4;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.systems-shield-wave {
  fill: none;
  stroke: rgba(220, 245, 255, 0.55);
  stroke-width: 5;
  stroke-linejoin: round;
  stroke-linecap: round;
  transform-box: fill-box;
  transform-origin: center;
  animation: shield-wave 2.4s ease-out infinite;
}

.systems-shield-wave--b {
  animation-delay: 0.8s;
}

.systems-shield-wave--c {
  animation-delay: 1.6s;
}

.hud-systems.shields-off .systems-shield-wave,
.hud-systems.shields-off .systems-shield-glow,
.hud-systems.shields-off .systems-shield-ring {
  animation: none;
  opacity: 0;
}

.hud-systems.shields-off .systems-shield-label {
  color: var(--text-dim);
  text-shadow: none;
}

.systems-shield-label {
  position: absolute;
  right: 0.35rem;
  top: 0.25rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: #3dff9a;
  text-shadow: 0 0 8px rgba(61, 255, 154, 0.55);
}

.systems-list {
  list-style: none;
  display: grid;
  gap: 0.18rem;
}

.systems-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.68rem;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(61, 224, 255, 0.08);
  padding-bottom: 0.12rem;
}

.systems-list span {
  font-family: var(--font-display);
  font-size: 0.4rem;
  letter-spacing: 0.12em;
  color: var(--text-dim);
}

.systems-list b {
  font-family: var(--font-display);
  font-size: 0.46rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #3dff9a;
}

@keyframes shield-wave {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }
  75% {
    opacity: 0.08;
  }
  100% {
    transform: scale(1.16);
    opacity: 0;
  }
}

@keyframes shield-breathe {
  0%,
  100% {
    fill: rgba(210, 240, 255, 0.02);
  }
  50% {
    fill: rgba(210, 240, 255, 0.06);
  }
}

@media (prefers-reduced-motion: reduce) {
  .systems-shield-wave,
  .systems-shield-glow {
    animation: none;
  }
}

/* Command deck */
.hud-deck {
  left: 50%;
  bottom: 3.5rem;
  transform: translate(-50%, 14px);
  width: min(1120px, calc(100vw - 1.25rem));
  z-index: 58;
}

.hud-deck.is-online {
  transform: translate(-50%, 0);
}

body.is-auth .hud-login {
  display: none !important;
}

.hud-head--deck {
  flex-wrap: wrap;
}

.deck-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
}

.deck-tab {
  font-family: var(--font-display);
  font-size: 0.5rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0.4rem 0.55rem;
  border-bottom: 2px solid transparent;
}

.deck-tab.is-active {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
}

.deck-body {
  max-height: min(52vh, 460px);
  overflow: auto;
}

.deck-panel {
  padding: 0.75rem 0.85rem 0.95rem;
}

.deck-split {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(280px, 1.15fr);
  gap: 0.9rem;
}

.deck-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}

.deck-list {
  list-style: none;
  display: grid;
  gap: 0.4rem;
  max-height: 42vh;
  overflow: auto;
}

.deck-item {
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.6rem;
  border: 1px solid transparent;
  border-radius: 2px;
  background: rgba(4, 14, 32, 0.16);
}

.deck-item:hover,
.deck-item.is-active {
  border-color: rgba(61, 224, 255, 0.28);
  background: rgba(61, 224, 255, 0.08);
}

.deck-item-title {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
}

.deck-item-meta {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 300;
}

.badge {
  display: inline-block;
  margin-right: 0.3rem;
  font-family: var(--font-display);
  font-size: 0.4rem;
  letter-spacing: 0.1em;
  padding: 0.12rem 0.3rem;
  border: 1px solid rgba(61, 224, 255, 0.25);
  color: var(--cyan);
  border-radius: 2px;
}

.badge--public {
  color: #3dff9a;
  border-color: rgba(61, 255, 154, 0.35);
}

.badge--ai {
  color: #c9a6ff;
  border-color: rgba(201, 166, 255, 0.35);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.field-row.three {
  grid-template-columns: 1fr 1fr 1fr;
}

.hud-field--rank {
  max-width: 6rem;
}

.form-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.form-msg {
  margin-top: 0.55rem;
  font-size: 0.78rem;
  color: #3dff9a;
}

.form-msg.is-error {
  color: #ff8a9b;
}

.member-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.member-picks label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.25rem 0.45rem;
  border-radius: 2px;
}

.showcase-admin-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.5rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 2px;
}

.deck-list--showcase {
  margin-top: 0.8rem;
}

@media (max-width: 900px) {
  .hud-login:not(.is-dragged) {
    top: calc(4.25rem + 16.5rem);
    right: 0.5rem;
    left: auto;
    bottom: auto;
    width: min(420px, calc(100vw - 1rem));
  }

  .hud-projects:not(.is-dragged),
  .hud-memory-panel:not(.is-dragged),
  .hud-deck:not(.is-dragged),
  .hud-about:not(.is-dragged) {
    left: 0.6rem;
    right: 0.6rem;
    width: auto;
    transform: none;
  }

  .hud-projects.is-online:not(.is-dragged),
  .hud-memory-panel.is-online:not(.is-dragged),
  .hud-deck.is-online:not(.is-dragged),
  .hud-about.is-online:not(.is-dragged) {
    transform: none;
  }

  .realm-grid {
    grid-template-columns: 1fr;
  }

  .about-body {
    display: block;
    min-height: 18rem;
    padding: 0.85rem 0.85rem 0.35rem;
  }

  .about-copy {
    max-width: none;
    padding: 0 0 8.25rem;
  }

  .hud-systems:not(.is-dragged) {
    left: 0.6rem;
    right: auto;
    bottom: 0.75rem;
    width: min(446px, calc(100vw - 1.2rem));
  }

  .hud-systems .systems-ship-stage {
    width: 100%;
  }

  .about-pillars li {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .about-visual {
    width: min(78%, 280px);
    margin: 0.6rem auto 0;
  }

  .about-ship {
    width: 100%;
    margin: 0;
  }

  .deck-split,
  .field-row,
  .field-row.three {
    grid-template-columns: 1fr;
  }

  body.is-bridge .cta-row {
    display: none;
  }
}

@media (max-height: 740px) {
  body.is-bridge .subtitle,
  body.is-bridge .title-divider {
    display: none;
  }

  .deck-body {
    max-height: 46vh;
  }
}
