/* ==========================================================================
   dlino.us — Fullscreen 3D Aerospace WebGL Engine Stylesheet
   Pure 3D Viewport, Zero Cards, High-Tech Floating Telemetry HUD
   ========================================================================== */

:root {
  --space-void: #020307;
  --neon-cyan: #00f2fe;
  --neon-violet: #a855f7;
  --ion-blue: #3b82f6;

  --text-pure: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-cyan: rgba(0, 242, 254, 0.35);

  --font-sans: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --ease-warp: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--space-void);
  color: var(--text-pure);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

/* --------------------------------------------------------------------------
   3D Fullscreen WebGL Viewport
   -------------------------------------------------------------------------- */

#webgl-canvas-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
  cursor: grab;
}

#webgl-canvas-container:active {
  cursor: grabbing;
}

#webgl-canvas-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* --------------------------------------------------------------------------
   Floating HUD Overlay Layer
   -------------------------------------------------------------------------- */

.hud-overlay-layer {
  position: relative;
  z-index: 10;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  pointer-events: none; /* Allows 3D drag interactions on canvas */
}

/* Interactive elements opt back into pointer events */
.aerospace-hud,
.hud-bridge-controls,
.bottom-aerospace-hud,
button,
a,
input,
textarea {
  pointer-events: auto;
}

/* --------------------------------------------------------------------------
   Top Aerospace HUD
   -------------------------------------------------------------------------- */

.aerospace-hud {
  width: 100%;
  max-width: 1360px;
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hud-ship-status {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0.95rem;
  background: rgba(10, 15, 28, 0.65);
  border: 1px solid var(--border-cyan);
  border-radius: 9999px;
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.15),
              inset 0 1px 0 rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
}

.beacon-signal {
  position: relative;
  width: 8px;
  height: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.beacon-core {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--neon-cyan);
  box-shadow: 0 0 10px var(--neon-cyan);
}

.beacon-wave {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--neon-cyan);
  animation: beaconPulse 2.4s infinite cubic-bezier(0, 0.2, 0.8, 1);
}

.hud-mono-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--neon-cyan);
  font-weight: 600;
}

.ion-audio-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.95rem;
  background: rgba(10, 15, 28, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.25s var(--ease-warp);
  backdrop-filter: blur(12px);
}

.ion-audio-btn:hover {
  color: var(--neon-cyan);
  border-color: var(--neon-cyan);
  transform: translateY(-1px);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.25);
}

.ion-audio-btn .audio-icon {
  width: 16px;
  height: 16px;
}

.ion-audio-btn.active {
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.3);
}

.ion-audio-btn.active .sound-off { display: none; }
.ion-audio-btn.active .sound-on { display: block; }
.ion-audio-btn:not(.active) .sound-off { display: block; }
.ion-audio-btn:not(.active) .sound-on { display: none; }

/* --------------------------------------------------------------------------
   Bridge Controls & The Action Top
   -------------------------------------------------------------------------- */

.hud-bridge-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-top: auto;
  margin-bottom: 2rem;
  z-index: 20;
}

.bridge-headline {
  margin-bottom: 1.25rem;
}

.aerospace-badge {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.32em;
  color: var(--neon-cyan);
  text-transform: uppercase;
  font-weight: 600;
  text-shadow: 0 0 14px var(--neon-cyan);
  padding: 0.25rem 0.9rem;
  background: rgba(6, 9, 18, 0.75);
  border: 1px solid rgba(0, 242, 254, 0.25);
  border-radius: 4px;
  backdrop-filter: blur(8px);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.ignition-dock {
  position: relative;
}

.ignition-cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  transform: translateZ(0);
}

.ion-flux-border {
  position: absolute;
  inset: -2px;
  border-radius: 9999px;
  background: linear-gradient(
    135deg,
    var(--neon-cyan),
    var(--ion-blue),
    var(--neon-violet),
    var(--neon-cyan)
  );
  background-size: 300% 300%;
  animation: fluxRotate 5s linear infinite;
  filter: blur(4px);
  opacity: 0.65;
  transition: opacity 0.3s ease, filter 0.3s ease;
  z-index: 1;
}

.ignition-cta:hover .ion-flux-border {
  opacity: 1;
  filter: blur(8px);
}

.ignition-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1.15rem 2.85rem;
  background: linear-gradient(180deg, #090e1c 0%, #04060d 100%);
  border: 1px solid rgba(0, 242, 254, 0.4);
  border-radius: 9999px;
  color: var(--text-pure);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.85),
              0 0 25px rgba(0, 242, 254, 0.25);
  transition: all 0.25s var(--ease-warp);
  backdrop-filter: blur(16px);
}

.thruster-spark {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--neon-cyan);
  box-shadow: 0 0 12px var(--neon-cyan);
  animation: sparkPulse 1.8s infinite ease-in-out;
}

.ignition-arrow svg {
  width: 18px;
  height: 18px;
  color: var(--neon-cyan);
  transition: transform 0.3s var(--ease-warp);
}

.ignition-cta:hover .ignition-content {
  color: #ffffff;
  border-color: var(--neon-cyan);
  transform: translateY(-2px);
  box-shadow: 0 18px 50px rgba(0, 242, 254, 0.45),
              0 0 35px rgba(168, 85, 247, 0.35);
}

.ignition-cta:hover .ignition-arrow svg {
  transform: translateX(4px);
}

.ignition-cta:active .ignition-content {
  transform: translateY(1px);
}

/* --------------------------------------------------------------------------
   Bottom Telemetry HUD
   -------------------------------------------------------------------------- */

.bottom-aerospace-hud {
  width: 100%;
  max-width: 1360px;
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

.hud-telemetry {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.telemetry-coord {
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.telemetry-sep {
  color: rgba(0, 242, 254, 0.3);
}

.hud-copyright {
  letter-spacing: 0.08em;
  color: #475569;
}

/* --------------------------------------------------------------------------
   Aerospace Communication Terminal (HUD Dialog)
   -------------------------------------------------------------------------- */

.aerospace-terminal {
  padding: 0;
  border: none;
  background: transparent;
  max-width: min(92vw, 500px);
  width: 100%;
  margin: auto;
  border-radius: 20px;
  color: var(--text-pure);
  overflow: visible;
  z-index: 9999;
}

.aerospace-terminal:not([open]) {
  display: none;
}

.aerospace-terminal[open] {
  display: block;
  animation: terminalOpen 0.32s var(--ease-warp) forwards;
}

@keyframes terminalOpen {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.aerospace-terminal::backdrop {
  background: rgba(2, 3, 7, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.terminal-chassis {
  position: relative;
  background: linear-gradient(165deg, rgba(13, 19, 34, 0.95) 0%, rgba(4, 6, 13, 0.98) 100%);
  border: 1px solid var(--border-cyan);
  border-radius: 20px;
  padding: 2.25rem 2rem;
  box-shadow: 0 40px 100px -15px rgba(0, 0, 0, 0.95),
              0 0 50px rgba(0, 242, 254, 0.25),
              inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.terminal-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.terminal-close-btn:hover {
  color: #fff;
  border-color: var(--neon-cyan);
  background: rgba(0, 242, 254, 0.15);
  transform: scale(1.08);
}

.terminal-close-btn svg {
  width: 16px;
  height: 16px;
}

.terminal-status-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: var(--neon-cyan);
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid rgba(0, 242, 254, 0.3);
  padding: 0.2rem 0.65rem;
  border-radius: 4px;
  margin-bottom: 0.85rem;
}

.terminal-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.terminal-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

/* Uplink Cards */
.uplink-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.uplink-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.95rem 1.15rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-pure);
  transition: all 0.25s var(--ease-warp);
}

.uplink-card:hover {
  background: rgba(0, 242, 254, 0.06);
  border-color: var(--neon-cyan);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 242, 254, 0.2);
}

.whatsapp-uplink .uplink-icon { color: #25d366; }
.email-uplink .uplink-icon { color: var(--neon-cyan); }

.uplink-icon svg {
  width: 24px;
  height: 24px;
}

.uplink-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  text-align: left;
}

.uplink-title {
  font-size: 0.9rem;
  font-weight: 600;
}

.uplink-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.uplink-arrow {
  font-size: 1.1rem;
  color: var(--text-dim);
  transition: transform 0.2s ease, color 0.2s ease;
}

.uplink-card:hover .uplink-arrow {
  transform: translateX(4px);
  color: #fff;
}

/* Divider */
.terminal-divider {
  display: flex;
  align-items: center;
  margin: 1.25rem 0;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
}

.terminal-divider::before, .terminal-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-subtle);
}

.terminal-divider span {
  padding: 0 0.75rem;
}

/* Brief Form */
.brief-form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  text-align: left;
}

.form-row {
  display: flex;
  gap: 0.75rem;
}

.form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-pure);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 0 2px rgba(0, 242, 254, 0.15);
}

.submit-brief-btn {
  margin-top: 0.4rem;
  padding: 0.9rem;
  background: linear-gradient(135deg, var(--neon-cyan), var(--ion-blue));
  border: none;
  border-radius: 8px;
  color: #020307;
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.25s ease;
}

.submit-brief-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 8px 30px rgba(0, 242, 254, 0.45);
}

.btn-arrow-icon {
  width: 16px;
  height: 16px;
}

.transmission-success-alert {
  margin-top: 1rem;
  padding: 0.8rem;
  border-radius: 8px;
  background: rgba(0, 242, 254, 0.12);
  border: 1px solid rgba(0, 242, 254, 0.4);
  color: var(--neon-cyan);
  font-size: 0.82rem;
  font-family: var(--font-mono);
}

/* Keyframes */
@keyframes beaconPulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(3.5); opacity: 0; }
}

@keyframes fluxRotate {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes sparkPulse {
  0%, 100% { opacity: 0.4; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.3); }
}

/* Responsive */
@media (max-width: 640px) {
  .aerospace-hud { padding: 1.25rem; }
  .bottom-aerospace-hud {
    padding: 1.25rem;
    flex-direction: column;
    gap: 0.6rem;
    text-align: center;
  }
  .form-row { flex-direction: column; }
  .ignition-content {
    padding: 1rem 2rem;
    font-size: 0.86rem;
  }
  .terminal-chassis { padding: 1.75rem 1.25rem; }
}
