:root {
  --lime: #ccff00;
  --lime-dim: #a8d400;
  --black: #000000;
  --panel: #0d0d0dcc;
  --panel-alt: #161616;
  --text: #f5f5f5;
  --muted: #9a9a9a;
  --border: #2a2a2a;
  --bubble-bot: #1a1a1a;
  --bubble-user: #ccff00;
  --bubble-user-text: #000000;
  --font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--black);
  color: var(--text);
  font-family: var(--font-body);
  overflow-x: hidden;
}

/* ---------- Ambient background ---------- */

.bg-fx {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-grid {
  position: absolute;
  inset: -1px;
  background-image: linear-gradient(rgba(204, 255, 0, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(204, 255, 0, 0.05) 1px, transparent 1px);
  background-size: 42px 42px;
  -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 40%, transparent 85%);
  mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 40%, transparent 85%);
}

.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
}

.bg-glow-lime {
  width: 520px;
  height: 520px;
  top: -220px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, var(--lime) 0%, transparent 70%);
  animation: drift-a 16s ease-in-out infinite;
}

.bg-glow-dim {
  width: 420px;
  height: 420px;
  top: 260px;
  left: 60%;
  background: radial-gradient(circle, #6f8a00 0%, transparent 70%);
  opacity: 0.22;
  animation: drift-b 20s ease-in-out infinite;
}

@keyframes drift-a {
  0%,
  100% {
    transform: translate(-50%, 0) scale(1);
  }
  50% {
    transform: translate(-46%, 30px) scale(1.08);
  }
}

@keyframes drift-b {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(-40px, -25px) scale(0.94);
  }
}

.page {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

/* ---------- Hero / presentation section ---------- */

.hero {
  text-align: center;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.hero > * {
  opacity: 0;
  animation: rise 0.6s ease forwards;
}

.hero > *:nth-child(1) {
  animation-delay: 0.02s;
}
.hero > *:nth-child(2) {
  animation-delay: 0.1s;
}
.hero > *:nth-child(3) {
  animation-delay: 0.18s;
}
.hero > *:nth-child(4) {
  animation-delay: 0.26s;
}
.hero > *:nth-child(5) {
  animation-delay: 0.34s;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.eyebrow {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--lime);
  font-weight: 600;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(204, 255, 0, 0.3);
  background: rgba(204, 255, 0, 0.06);
}

.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 8px var(--lime);
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.8);
  }
}

.title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 10vw, 4.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1;
}

.title-accent {
  color: var(--lime);
  text-shadow: 0 0 24px rgba(204, 255, 0, 0.55), 0 0 60px rgba(204, 255, 0, 0.25);
}

.subtitle {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--text);
  font-weight: 500;
}

.description {
  margin: 4px 0 8px;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--muted);
}

.x-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  background: var(--lime);
  color: var(--black);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  box-shadow: 0 0 0 0 rgba(204, 255, 0, 0.5);
  transition: transform 0.15s ease, box-shadow 0.25s ease, background 0.15s ease;
}

.x-button:hover {
  background: var(--lime-dim);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(204, 255, 0, 0.35);
}

.x-button svg {
  transition: transform 0.2s ease;
}

.x-button:hover svg {
  transform: rotate(-8deg);
}

/* ---------- Chat section ---------- */

.chat-section {
  width: 100%;
  margin-top: 44px;
  display: flex;
  justify-content: center;
  opacity: 0;
  animation: rise 0.6s ease forwards;
  animation-delay: 0.42s;
}

.chat-box {
  width: 100%;
  max-width: 560px;
  background: var(--panel);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 0 0 1px rgba(204, 255, 0, 0.06), 0 30px 80px rgba(0, 0, 0, 0.6),
    0 0 40px rgba(204, 255, 0, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-box-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-alt);
}

.chat-box-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--lime);
  color: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(204, 255, 0, 0.45);
}

.chat-box-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
}

.chat-box-status {
  margin: 2px 0 0;
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 6px var(--lime);
  animation: pulse 1.8s ease-in-out infinite;
}

.chat-window {
  height: 420px;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.chat-window::-webkit-scrollbar {
  width: 6px;
}

.chat-window::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}

.message-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 85%;
  animation: msg-in 0.25s ease;
}

@keyframes msg-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-row.from-bot {
  align-self: flex-start;
}

.message-row.from-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--lime);
  color: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.bubble {
  padding: 10px 14px;
  border-radius: 16px;
  line-height: 1.45;
  font-size: 0.92rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.from-bot .bubble {
  background: var(--bubble-bot);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.from-user .bubble {
  background: var(--bubble-user);
  color: var(--bubble-user-text);
  border-bottom-right-radius: 4px;
  font-weight: 500;
  box-shadow: 0 2px 14px rgba(204, 255, 0, 0.2);
}

.bubble.typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 14px;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: bounce 1.2s infinite ease-in-out;
}

.dot:nth-child(2) {
  animation-delay: 0.15s;
}
.dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes bounce {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.error-banner {
  align-self: center;
  background: #2a1414;
  color: #ff8a80;
  border: 1px solid #4a1f1f;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  max-width: 90%;
  text-align: center;
}

.composer {
  display: flex;
  gap: 8px;
  padding: 14px;
  border-top: 1px solid var(--border);
  background: var(--panel-alt);
}

.composer input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--black);
  color: var(--text);
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.composer input:focus {
  border-color: var(--lime);
  box-shadow: 0 0 0 3px rgba(204, 255, 0, 0.15);
}

.composer input::placeholder {
  color: var(--muted);
}

.composer button {
  padding: 10px 20px;
  border-radius: 999px;
  border: none;
  background: var(--lime);
  color: var(--black);
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.12s ease, transform 0.12s ease, box-shadow 0.2s ease;
}

.composer button:hover:not(:disabled) {
  background: var(--lime-dim);
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(204, 255, 0, 0.3);
}

.composer button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---------- Footer ---------- */

.disclaimer {
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
  padding: 28px 16px 8px;
  max-width: 560px;
}

/* ---------- Motion & small-screen safety ---------- */

@media (prefers-reduced-motion: reduce) {
  .hero > *,
  .chat-section,
  .eyebrow-dot,
  .status-dot,
  .bg-glow-lime,
  .bg-glow-dim,
  .message-row {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

@media (max-width: 480px) {
  .chat-window {
    height: 60vh;
  }
}
