:root {
  --bg-deep: #040911;
  --bg-mid: #081827;
  --bg-low: #02050c;
  --neon-cyan: #63ffe3;
  --neon-blue: #47c4ff;
  --neon-violet: #9c87ff;
  --text-primary: #e8f8ff;
  --text-soft: #9cc7d9;
  --glass: rgba(7, 22, 35, 0.56);
  --glass-border: rgba(115, 235, 255, 0.34);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
}

body {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--text-primary);
  background:
    radial-gradient(circle at 15% 20%, rgba(76, 153, 255, 0.2), transparent 35%),
    radial-gradient(circle at 80% 15%, rgba(126, 90, 255, 0.24), transparent 39%),
    radial-gradient(circle at 52% 80%, rgba(73, 255, 219, 0.11), transparent 42%),
    linear-gradient(150deg, var(--bg-deep), var(--bg-mid) 45%, var(--bg-low));
  overflow-x: hidden;
  position: relative;
}

#particle-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 60;
}

.noise-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 0.6px, transparent 0.6px);
  background-size: 3px 3px;
  opacity: 0.08;
  z-index: 1;
}

.hud-boot {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 30% 20%, rgba(29, 120, 196, 0.32), transparent 32%), linear-gradient(145deg, rgba(3, 10, 20, 0.96), rgba(2, 6, 12, 0.98));
  transition: opacity 700ms ease;
}

.hud-boot.hidden {
  opacity: 0;
  pointer-events: none;
}

.hud-grid {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(90deg, rgba(117, 212, 255, 0.08) 0 1px, transparent 1px 36px),
    repeating-linear-gradient(0deg, rgba(117, 212, 255, 0.08) 0 1px, transparent 1px 36px);
  opacity: 0.34;
  animation: hudShift 8s linear infinite;
}

.hud-grid::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0 2px, transparent 2px 5px);
  mix-blend-mode: screen;
  opacity: 0.2;
}

.hud-panel {
  width: min(560px, 92vw);
  padding: 1.45rem;
  border: 1px solid rgba(125, 232, 255, 0.4);
  border-radius: 16px;
  background: rgba(5, 19, 32, 0.72);
  box-shadow: inset 0 0 24px rgba(105, 237, 255, 0.12), 0 30px 54px rgba(0, 0, 0, 0.45);
  position: relative;
  overflow: hidden;
}

.hud-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 25%, rgba(114, 227, 255, 0.18) 45%, transparent 65%);
  transform: translateX(-120%);
  animation: hudSweep 1.7s ease-in-out infinite;
}

.hud-panel.compact {
  width: min(500px, 90vw);
}

.hud-label {
  margin: 0;
  font-family: "Orbitron", sans-serif;
  letter-spacing: 0.2em;
  font-size: 0.72rem;
  color: #9cf9ff;
}

.hud-panel h2 {
  margin: 0.7rem 0 0;
  font-family: "Orbitron", sans-serif;
  font-size: clamp(1.3rem, 4.6vw, 2.1rem);
}

.hud-sub {
  margin: 0.52rem 0 0;
  color: var(--text-soft);
}

.hud-progress-track {
  margin-top: 1.1rem;
  height: 11px;
  border-radius: 999px;
  background: rgba(121, 185, 255, 0.16);
  overflow: hidden;
}

.hud-progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(100deg, var(--neon-cyan), var(--neon-blue));
  box-shadow: 0 0 18px rgba(104, 255, 237, 0.45);
  transition: width 120ms linear;
}

.hud-percent {
  margin: 0.45rem 0 0;
  text-align: right;
  color: #b4fbff;
  font-family: "Orbitron", sans-serif;
  letter-spacing: 0.08em;
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0.95rem 4vw;
  backdrop-filter: blur(12px);
  background: rgba(3, 10, 18, 0.56);
  border-bottom: 1px solid rgba(96, 214, 255, 0.2);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-logo {
  width: 42px;
  height: 42px;
  filter: drop-shadow(0 0 14px rgba(100, 255, 230, 0.45));
}

.brand-title {
  margin: 0;
  font-family: "Orbitron", sans-serif;
  font-weight: 700;
  letter-spacing: 0.07em;
  font-size: 0.93rem;
}

.brand-subtitle {
  margin: 0.1rem 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.main-nav {
  justify-self: center;
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.nav-link {
  text-decoration: none;
  color: #d6f8ff;
  padding: 0.5rem 0.84rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: 200ms ease;
}

.nav-link:hover,
.nav-link.active {
  border-color: rgba(125, 232, 255, 0.45);
  background: rgba(67, 170, 255, 0.18);
  box-shadow: 0 0 16px rgba(99, 203, 255, 0.24);
}

.status-pills {
  display: flex;
  gap: 0.65rem;
  align-items: center;
}

.mode-chip {
  border: 1px solid rgba(135, 242, 255, 0.4);
  color: #b8faff;
  background: rgba(68, 151, 214, 0.15);
  padding: 0.45rem 0.72rem;
  border-radius: 999px;
  font-size: 0.8rem;
  white-space: nowrap;
}

.ghost-btn {
  border: 1px solid rgba(135, 242, 255, 0.5);
  color: #d9ffff;
  background: linear-gradient(120deg, rgba(97, 239, 255, 0.14), rgba(79, 115, 255, 0.09));
  padding: 0.58rem 0.95rem;
  border-radius: 999px;
  font-family: "Orbitron", sans-serif;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: 220ms ease;
}

.ghost-btn:hover {
  box-shadow: 0 0 18px rgba(105, 236, 255, 0.35);
  transform: translateY(-1px);
}

.hero {
  position: relative;
  z-index: 2;
  min-height: calc(100vh - 84px);
  padding: 5.4rem 4vw 3.5rem;
}

.hero-home {
  display: grid;
  grid-template-columns: minmax(280px, 1.28fr) minmax(250px, 0.9fr);
  gap: clamp(1.2rem, 2.8vw, 2rem);
  align-items: center;
  overflow: hidden;
}

.holo-grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    repeating-linear-gradient(90deg, rgba(95, 176, 230, 0.1) 0 1px, transparent 1px 65px),
    repeating-linear-gradient(0deg, rgba(95, 176, 230, 0.09) 0 1px, transparent 1px 65px);
  transform: perspective(900px) rotateX(58deg) translateY(45%);
  transform-origin: center bottom;
  opacity: 0.42;
  animation: gridDrift 13s linear infinite;
}

.panel,
.orbit-module,
.system-card,
.chat-feed,
.chat-side,
.chat-form,
.glass-card {
  position: relative;
  z-index: 3;
  background: linear-gradient(160deg, rgba(7, 27, 42, 0.72), rgba(7, 20, 35, 0.45));
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  box-shadow: inset 0 0 22px rgba(116, 255, 231, 0.08), 0 24px 54px rgba(0, 0, 0, 0.38);
}

.floating-cards {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  isolation: isolate;
  overflow: visible;
}

.floating-card {
  position: absolute;
  left: 0;
  top: 0;
  width: max-content;
  max-width: 210px;
  min-height: 52px;
  padding: 0.32rem 0.58rem 0.35rem 0.38rem;
  border-radius: 999px;
  border: 1px solid rgba(136, 240, 255, 0.4);
  background: linear-gradient(120deg, rgba(10, 41, 62, 0.72), rgba(8, 24, 40, 0.44));
  box-shadow:
    inset 0 0 18px rgba(111, 243, 255, 0.15),
    0 10px 26px rgba(0, 0, 0, 0.38),
    0 0 22px rgba(89, 220, 255, 0.15);
  backdrop-filter: blur(8px) saturate(125%);
  display: flex;
  align-items: center;
  gap: 0.48rem;
  transform: translate3d(-999px, -999px, 0);
  will-change: transform, opacity, filter;
  opacity: 0.9;
  pointer-events: auto;
  cursor: default;
  user-select: none;
  touch-action: none;
  transition: box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

.floating-card::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: radial-gradient(circle at 30% 30%, rgba(110, 250, 255, var(--node-glow, 0.24)), transparent 68%);
  filter: blur(10px);
  z-index: -1;
  pointer-events: none;
}

.floating-card::after {
  content: "";
  position: absolute;
  inset: -8px -18px;
  border-radius: 999px;
  border: 1px dashed rgba(126, 231, 255, 0.22);
  opacity: 0.45;
  animation: nodeSpin 9s linear infinite;
  pointer-events: none;
}

.floating-card:hover,
.floating-card.is-hovered {
  border-color: rgba(173, 251, 255, 0.88);
  background: linear-gradient(120deg, rgba(16, 57, 84, 0.82), rgba(8, 29, 47, 0.5));
  box-shadow:
    inset 0 0 26px rgba(126, 252, 255, 0.28),
    0 14px 34px rgba(0, 0, 0, 0.44),
    0 0 28px rgba(88, 235, 255, 0.3);
}

.mini-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex: none;
  filter: drop-shadow(0 0 12px rgba(108, 255, 235, 0.42));
}

.mini-title {
  margin: 0;
  font-family: "Orbitron", sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.07em;
  color: #d9ffff;
  white-space: nowrap;
}

.mini-sub {
  margin: 0.16rem 0 0;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: #99d4e7;
  text-transform: uppercase;
  white-space: nowrap;
}

.panel {
  padding: clamp(1.15rem, 2vw, 1.9rem);
}

.kicker {
  margin: 0;
  font-family: "Orbitron", sans-serif;
  color: #96fbff;
  letter-spacing: 0.2em;
  font-size: 0.74rem;
}

h1 {
  margin: 0.72rem 0;
  font-family: "Orbitron", sans-serif;
  font-size: clamp(2rem, 4.6vw, 4rem);
  letter-spacing: 0.06em;
  line-height: 1.04;
  text-shadow: 0 0 30px rgba(109, 228, 255, 0.25);
}

.description {
  max-width: 60ch;
  margin: 0;
  color: var(--text-soft);
  line-height: 1.7;
}

.actions {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.78rem;
}

.cta-btn {
  border: 1px solid rgba(105, 255, 221, 0.56);
  color: #071921;
  background: linear-gradient(100deg, #85ffe9, #5dbfff);
  padding: 0.68rem 1.05rem;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 26px rgba(110, 255, 232, 0.35);
}

.cta-btn.secondary {
  color: #dbf6ff;
  background: rgba(19, 47, 66, 0.35);
  border-color: rgba(151, 197, 255, 0.55);
}

.orbit-module {
  position: relative;
  min-height: 380px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.core-icon {
  width: min(46%, 210px);
  animation: pulseGlow 2.8s ease-in-out infinite;
  filter: drop-shadow(0 0 24px rgba(118, 251, 255, 0.65));
}

.ring {
  position: absolute;
  border: 1px solid rgba(109, 230, 255, 0.5);
  border-radius: 50%;
}

.ring-a {
  width: 72%;
  height: 72%;
  animation: spin 20s linear infinite;
}

.ring-b {
  width: 88%;
  height: 88%;
  border-style: dashed;
  border-color: rgba(139, 121, 255, 0.48);
  animation: spinReverse 16s linear infinite;
}

.ring-c {
  width: 52%;
  height: 52%;
  border-color: rgba(109, 255, 210, 0.5);
  animation: spin 12s linear infinite;
}

.scan-text {
  position: absolute;
  bottom: 1.05rem;
  margin: 0;
  font-family: "Orbitron", sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: #9bffff;
}

.status-grid {
  position: relative;
  z-index: 2;
  padding: 0 4vw 4rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 1rem;
}

.glass-card {
  padding: 1rem;
  backdrop-filter: blur(7px);
}

.glass-card h2,
.system-card h2,
.chat-side h2 {
  margin: 0;
  font-family: "Orbitron", sans-serif;
  font-size: 1rem;
  letter-spacing: 0.08em;
}

.glass-card p,
.system-card p,
.chat-side p {
  margin: 0.55rem 0 0;
  color: var(--text-soft);
  line-height: 1.62;
}

.page-shell {
  position: relative;
  z-index: 2;
  padding: 2.4rem 4vw 3.4rem;
}

.section-title {
  margin-bottom: 1.2rem;
}

.cockpit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(200px, 1fr));
  gap: 1rem;
}

.system-card {
  padding: 1rem;
}

.system-card.wide {
  grid-column: span 2;
}

.metric {
  margin: 0.75rem 0 0;
  font-family: "Orbitron", sans-serif;
  font-size: clamp(2rem, 4vw, 3.1rem);
  color: #9dfff2;
}

.metric span {
  font-size: 1rem;
  color: #9ec6df;
  margin-left: 0.38rem;
}

.progress-line {
  margin: 0.4rem 0 0.7rem;
  height: 9px;
  border-radius: 999px;
  background: rgba(95, 182, 255, 0.15);
  overflow: hidden;
}

.progress-line i {
  display: block;
  width: var(--w, 50%);
  height: 100%;
  background: linear-gradient(100deg, #79ffd8, #58bbff);
  box-shadow: 0 0 16px rgba(106, 250, 239, 0.45);
}

.chat-shell {
  max-width: 1200px;
  margin: 0 auto;
}

.chat-grid {
  display: grid;
  grid-template-columns: minmax(280px, 2fr) minmax(240px, 1fr);
  gap: 0.95rem;
}

.chat-feed {
  min-height: 360px;
  max-height: 460px;
  overflow: auto;
  padding: 1rem;
}

.bubble {
  margin: 0.64rem 0;
  max-width: 78%;
  padding: 0.72rem 0.8rem;
  border-radius: 14px;
  border: 1px solid rgba(125, 227, 255, 0.32);
  background: rgba(12, 33, 53, 0.55);
}

.bubble.user {
  margin-left: auto;
  background: rgba(78, 120, 255, 0.22);
  border-color: rgba(139, 168, 255, 0.5);
}

.bubble p {
  margin: 0;
  line-height: 1.58;
}

.bubble time {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.75rem;
  color: #8db7ce;
}

.chat-side {
  padding: 1rem;
}

.chip {
  width: 100%;
  margin-top: 0.65rem;
  border: 1px solid rgba(125, 227, 255, 0.35);
  border-radius: 999px;
  background: rgba(56, 127, 176, 0.15);
  color: #d6f7ff;
  padding: 0.52rem 0.82rem;
  text-align: left;
  cursor: pointer;
  transition: 180ms ease;
}

.chip:hover {
  background: rgba(76, 169, 233, 0.3);
}

.chat-form {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.7rem;
  padding: 0.8rem;
}

.chat-form input {
  border: 1px solid rgba(126, 220, 255, 0.4);
  border-radius: 999px;
  background: rgba(5, 18, 30, 0.75);
  color: #dff8ff;
  padding: 0.68rem 0.95rem;
  outline: none;
}

.chat-form input:focus {
  border-color: rgba(117, 247, 233, 0.9);
  box-shadow: 0 0 0 3px rgba(93, 184, 255, 0.25);
}

@keyframes gridDrift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 65px 0, 0 65px; }
}

@keyframes hudShift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 36px 0, 0 36px; }
}

@keyframes hudSweep {
  from { transform: translateX(-120%); }
  to { transform: translateX(120%); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes spinReverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

@keyframes pulseGlow {
  0%,
  100% { transform: scale(1); }
  50% { transform: scale(1.045); }
}

@keyframes nodeSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (max-width: 1120px) {
  .top-bar {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 0.7rem;
  }

  .hero-home {
    grid-template-columns: 1fr;
    padding-top: 3.8rem;
  }

  .floating-card {
    max-width: 176px;
    min-height: 48px;
    padding: 0.3rem 0.45rem 0.33rem 0.32rem;
    opacity: 0.8;
  }

  .status-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .orbit-module {
    min-height: 320px;
    max-width: 560px;
    width: 100%;
    justify-self: center;
  }

  .cockpit-grid {
    grid-template-columns: repeat(2, minmax(190px, 1fr));
  }

  .system-card.wide {
    grid-column: span 2;
  }

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

@media (max-width: 680px) {
  .brand-logo {
    width: 38px;
    height: 38px;
  }

  .brand-subtitle {
    font-size: 0.66rem;
  }

  .status-pills {
    flex-wrap: wrap;
    justify-content: center;
  }

  .mode-chip {
    font-size: 0.72rem;
  }

  .ghost-btn {
    padding: 0.5rem 0.74rem;
    font-size: 0.72rem;
  }

  .status-grid,
  .cockpit-grid {
    grid-template-columns: 1fr;
  }

  .floating-cards {
    opacity: 0.7;
  }

  .floating-card {
    max-width: 142px;
    min-height: 44px;
    padding: 0.25rem 0.38rem 0.28rem 0.28rem;
  }

  .mini-icon {
    width: 22px;
    height: 22px;
  }

  .mini-title {
    font-size: 0.58rem;
  }

  .mini-sub {
    font-size: 0.52rem;
  }

  .system-card.wide {
    grid-column: auto;
  }

  .chat-form {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(1.7rem, 11vw, 2.6rem);
  }
}
