/* ============================================================
   CONTACT HUD — Global overlay accessible from all pages
   Triggered by #contactToggle in nav bar + #hudContactBtn in HUD
   ============================================================ */

/* Overlay backdrop */
.contact-hud-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(1, 3, 8, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.contact-hud-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

/* Panel */
.contact-hud-panel {
  position: relative;
  width: min(520px, 92vw);
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(135deg, rgba(5, 8, 16, 0.95), rgba(8, 14, 28, 0.92)),
    rgba(0, 0, 0, 0.4);
  box-shadow:
    0 40px 80px rgba(0, 0, 0, 0.6),
    inset 0 0 40px rgba(148, 226, 255, 0.03);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.35s cubic-bezier(0.2, 0, 0, 1);
}

.contact-hud-overlay.is-open .contact-hud-panel {
  transform: translateY(0) scale(1);
}

.contact-hud-panel { scrollbar-width: thin; }
.contact-hud-panel::-webkit-scrollbar { width: 4px; }
.contact-hud-panel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
}

/* Close button */
.contact-hud-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.5);
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.contact-hud-close:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.85);
}

/* Form inside panel */
.contact-hud-panel h2 {
  font-family: 'Syne', sans-serif;
  font-size: 1.3rem;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.9);
  margin: 0 0 0.25rem;
}

.contact-hud-panel .contact-hud-sub {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(148, 226, 255, 0.35);
  margin: 0 0 1.5rem;
}

.contact-hud-panel .connect-form {
  border: none;
  background: none;
  box-shadow: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-hud-panel .connect-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.contact-hud-panel .connect-form input,
.contact-hud-panel .connect-form textarea {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 0.75rem 0.9rem;
  background: rgba(1, 3, 8, 0.5);
  color: rgba(255, 255, 255, 0.9);
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
  transition: border-color 0.2s;
}

.contact-hud-panel .connect-form input:focus,
.contact-hud-panel .connect-form textarea:focus {
  outline: none;
  border-color: rgba(148, 226, 255, 0.3);
}

.contact-hud-panel .connect-form textarea {
  min-height: 100px;
  resize: vertical;
}

.contact-hud-panel .connect-form button[type="submit"] {
  align-self: flex-start;
  padding: 0.7rem 1.8rem;
  border: 1px solid rgba(148, 226, 255, 0.2);
  border-radius: 6px;
  background: rgba(148, 226, 255, 0.05);
  color: rgba(148, 226, 255, 0.7);
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.25s ease;
}

.contact-hud-panel .connect-form button[type="submit"]:hover {
  border-color: rgba(148, 226, 255, 0.4);
  background: rgba(148, 226, 255, 0.1);
  color: rgba(148, 226, 255, 0.95);
}

.contact-hud-panel .form-status {
  font-size: 0.75rem;
  color: rgba(148, 226, 255, 0.5);
  margin: 0;
}

/* Mailing list toggle */
.contact-hud-mailing {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.contact-hud-toggle {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  user-select: none;
}

.contact-hud-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.contact-hud-toggle-track {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.contact-hud-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transition: transform 0.25s ease, background 0.25s ease;
}

.contact-hud-toggle input:checked ~ .contact-hud-toggle-track {
  background: rgba(0, 255, 163, 0.15);
  border-color: rgba(0, 255, 163, 0.3);
}

.contact-hud-toggle input:checked ~ .contact-hud-toggle-track .contact-hud-toggle-thumb {
  transform: translateX(16px);
  background: rgba(0, 255, 163, 0.8);
}

.contact-hud-toggle-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.55);
}

.contact-hud-mailing-note {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.25);
  margin: 0;
  padding-left: calc(36px + 0.65rem);
  line-height: 1.5;
  letter-spacing: 0.02em;
}
