:root {
  color-scheme: dark;
  --ink: #ecfff8;
  --panel: rgba(10, 21, 18, 0.72);
  --panel-strong: rgba(12, 29, 25, 0.9);
  --line: rgba(161, 255, 221, 0.14);
  --line-strong: rgba(161, 255, 221, 0.28);
  --glow: #6bffcf;
  --aqua: #8cffea;
  --gold: #ffe39a;
  --graphite: #06100e;
}

* {
  box-sizing: border-box;
}

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

body {
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 44%, rgba(94, 255, 205, 0.13), transparent 23rem),
    radial-gradient(circle at 18% 14%, rgba(255, 227, 154, 0.09), transparent 18rem),
    linear-gradient(135deg, #07100f 0%, #0a1512 38%, #10110d 100%);
  font-family: "Oxanium", "Michroma", "Eurostile", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(236, 255, 248, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(236, 255, 248, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at center, black 0%, transparent 75%);
}

.shell {
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(360px, 1fr) minmax(280px, 34vw);
  gap: 1px;
  background: rgba(161, 255, 221, 0.09);
}

.rail,
.stage,
.context {
  position: relative;
  min-width: 0;
  background: linear-gradient(180deg, rgba(8, 17, 15, 0.92), rgba(6, 14, 12, 0.86));
  backdrop-filter: blur(18px);
}

.rail {
  padding: 22px 18px;
  border-right: 1px solid var(--line);
}

.rail-top,
.rail-stack,
.thread,
.composer,
.context {
  display: flex;
}

.rail-top {
  gap: 10px;
  align-items: center;
  margin-bottom: 34px;
}

.glyph {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(140, 255, 234, 0.13), rgba(255, 227, 154, 0.06));
  box-shadow: inset 0 0 24px rgba(107, 255, 207, 0.08);
}

.glyph-strong {
  border-color: var(--line-strong);
  box-shadow: 0 0 24px rgba(107, 255, 207, 0.16), inset 0 0 22px rgba(107, 255, 207, 0.15);
}

.glyph-short {
  width: 52px;
}

.rail-stack {
  flex-direction: column;
  gap: 12px;
}

.thread {
  height: 40px;
  gap: 12px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(161, 255, 221, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
}

.thread-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(140, 255, 234, 0.56);
  box-shadow: 0 0 16px rgba(140, 255, 234, 0.42);
}

.thread-line {
  width: min(100%, 118px);
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(236, 255, 248, 0.2), rgba(236, 255, 248, 0.04));
}

.stage {
  display: grid;
  place-items: center;
  overflow: hidden;
}

.chat-plane {
  position: relative;
  width: min(760px, 84%);
  height: min(720px, 88%);
}

.message {
  position: absolute;
  width: min(460px, 82%);
  height: 76px;
  border: 1px solid rgba(161, 255, 221, 0.1);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
}

.ghost-a {
  top: 13%;
  left: 2%;
}

.ghost-b {
  right: 0;
  bottom: 20%;
  width: min(390px, 72%);
}

.core-wrap {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 150px;
  height: 150px;
  display: grid;
  place-items: center;
}

.halo,
.orb,
.scan-ring {
  position: absolute;
  border-radius: 999px;
}

.halo {
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(107, 255, 207, 0.28) 0%, rgba(107, 255, 207, 0.07) 44%, transparent 68%);
  filter: blur(3px);
  animation: breathe 3.8s ease-in-out infinite;
}

.orb {
  width: 62px;
  height: 62px;
  background:
    radial-gradient(circle at 35% 28%, #ffffff 0%, var(--gold) 15%, transparent 27%),
    radial-gradient(circle at 58% 58%, var(--aqua), var(--glow) 34%, #123e34 72%);
  box-shadow:
    0 0 16px rgba(107, 255, 207, 0.86),
    0 0 58px rgba(107, 255, 207, 0.42),
    inset -12px -10px 26px rgba(1, 12, 10, 0.45);
  animation: rotateCore 5.4s cubic-bezier(.65, .05, .35, 1) infinite;
}

.facet {
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 45% 55% 50% 50%;
  transform-origin: center;
}

.f1 { transform: rotate(18deg) scaleX(0.82); }
.f2 { transform: rotate(83deg) scaleY(0.74); }
.f3 { transform: rotate(137deg) scaleX(0.68); }
.f4 { transform: rotate(222deg) scaleY(0.72); }

.scan-ring {
  width: 112px;
  height: 112px;
  border: 1px solid rgba(140, 255, 234, 0.23);
  animation: orbit 6.5s linear infinite;
}

.scan-b {
  width: 126px;
  height: 76px;
  border-color: rgba(255, 227, 154, 0.2);
  transform: rotateX(58deg);
  animation-duration: 4.8s;
  animation-direction: reverse;
}

.composer {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(560px, 92%);
  height: 54px;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border: 1px solid rgba(161, 255, 221, 0.16);
  border-radius: 16px;
  background: rgba(10, 21, 18, 0.72);
  box-shadow: 0 18px 80px rgba(0, 0, 0, 0.24);
}

.composer span:first-child {
  width: 60%;
  height: 8px;
  border-radius: 999px;
  background: rgba(236, 255, 248, 0.16);
}

.composer span:last-child {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(107, 255, 207, 0.36);
  box-shadow: 0 0 18px rgba(107, 255, 207, 0.32);
}

.context {
  flex-direction: column;
  justify-content: center;
  gap: 26px;
  padding: 34px;
  border-left: 1px solid var(--line);
}

.context-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.context-grid span {
  aspect-ratio: 1;
  border-radius: 12px;
  border: 1px solid rgba(161, 255, 221, 0.09);
  background:
    linear-gradient(135deg, rgba(140, 255, 234, 0.08), rgba(255, 227, 154, 0.035)),
    rgba(255, 255, 255, 0.02);
}

.context-path {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.context-path i {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(107, 255, 207, 0.44), rgba(255, 227, 154, 0.16));
}

@keyframes rotateCore {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(181deg) scale(1.07); }
  100% { transform: rotate(360deg) scale(1); }
}

@keyframes orbit {
  from { transform: rotate(0deg) rotateX(64deg); }
  to { transform: rotate(360deg) rotateX(64deg); }
}

@keyframes breathe {
  0%, 100% { opacity: 0.58; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.08); }
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 76px 1fr;
  }

  .context {
    display: none;
  }

  .rail {
    padding: 14px 10px;
  }

  .rail-top {
    flex-direction: column;
  }

  .glyph-short,
  .thread-line {
    display: none;
  }

  .thread {
    justify-content: center;
    padding: 0;
  }

  .chat-plane {
    width: 94%;
  }
}

@media (max-width: 560px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .rail {
    display: none;
  }

  .message {
    height: 58px;
  }

  .core-wrap {
    width: 120px;
    height: 120px;
  }

  .halo {
    width: 120px;
    height: 120px;
  }
}
