/* Core reset */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root{
  --bg: #0b0f1a;
  --panel: rgba(255,255,255,0.06);
  --panel-strong: rgba(255,255,255,0.12);
  --text: #e5ecff;
  --muted: #b3c0dd;
  --accent: #7dd3fc;
  --emerald: #34d399;
  --red: #ef4444;
  --blue: #60a5fa;
  --gold: #fbbf24;
}
html,body { height: 100%; background: var(--bg); color: var(--text); font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Apple Color Emoji","Segoe UI Emoji"; }
a { color: var(--accent); }

/* Space layers */
#stars { position: fixed; inset: 0; z-index: -2; }
.nebula {
  position: fixed; inset: -10vmax; z-index: -1;
  background:
    radial-gradient(60vmax 60vmax at 20% 30%, rgba(56,189,248,0.18), transparent 60%),
    radial-gradient(70vmax 70vmax at 80% 20%, rgba(52,211,153,0.14), transparent 60%),
    radial-gradient(60vmax 60vmax at 60% 80%, rgba(239,68,68,0.12), transparent 60%);
  filter: blur(14px) saturate(1.2);
  animation: drift 18s ease-in-out infinite alternate;
  transform: scale(1);
  pointer-events: none;
}
.nebula.idle { animation-duration: 8s; transform: scale(1.05); filter: blur(18px) saturate(1.4); }
@keyframes drift { from { transform: translateY(-1%) scale(1);} to { transform: translateY(1%) scale(1.02);} }

/* Header */
.site-header { text-align: center; padding: clamp(20px, 4vw, 48px) 16px 8px;}
.brand { font-weight: 800; letter-spacing: .2px; line-height: 1.2; font-size: clamp(18px, 3vw, 28px); }
.brand .blue { color: var(--blue); }
.brand .green { color: var(--emerald); }
.brand .red { color: var(--red); }
.subtitle { margin-top: 8px; color: var(--muted); }

/* Layout */
.layout { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; max-width: 1200px; margin: 0 auto; padding: 24px; }
@media (max-width: 1000px){ .layout { grid-template-columns: 1fr; } }

/* Orb zone */
.orb-zone { background: var(--panel); backdrop-filter: blur(8px); border: 1px solid var(--panel-strong);
  border-radius: 20px; padding: clamp(12px,2vw,20px); position: relative; overflow: hidden; }
.orb-wrap { display: grid; place-items: center; padding: clamp(24px,4vw,40px); position: relative; }
.orb { width: clamp(160px, 26vw, 280px); filter: drop-shadow(0 0 24px rgba(125,211,252,0.4)); animation: spin 36s linear infinite; }
@keyframes spin { from { transform: rotate(0deg);} to { transform: rotate(360deg);} }

.thoughts { position: absolute; inset: 0; pointer-events: none; }
.bubble {
  position: absolute; max-width: 260px;
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(125,211,252,0.35);
  color: var(--text); padding: 10px 12px; border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  backdrop-filter: blur(6px);
  opacity: 0; transform: translateY(10px) scale(.98);
  animation: bubbleIn .6s ease forwards;
}
.bubble::after{
  content:""; position:absolute; bottom:-10px; left:28px;
  width: 16px; height:16px; background: inherit; border: inherit; border-top: none; border-left: none;
  transform: rotate(45deg);
}
.bubble.q { border-color: rgba(96,165,250,0.45); }
.bubble.a { border-color: rgba(239,68,68,0.45); }
@keyframes bubbleIn { to { opacity: 1; transform: translateY(0) scale(1);} }

/* Search */
.search { display: flex; justify-content: center; padding: 8px 12px 16px; }
.search input {
  width: min(720px, 100%); padding: 12px 14px; border-radius: 12px; border: 1px solid var(--panel-strong);
  background: rgba(255,255,255,0.04); color: var(--text); outline: none;
}
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(125,211,252,0.2); }

/* Accordion */
.accordion { display: grid; gap: 10px; }
.item { background: var(--panel); border: 1px solid var(--panel-strong); border-radius: 14px; overflow: hidden; }
.item summary {
  list-style: none; cursor: pointer; padding: 14px 16px; font-weight: 600; position: relative;
}
.item summary::-webkit-details-marker { display: none; }
.item[open] summary { background: rgba(255,255,255,0.04); }
.item .answer { padding: 14px 16px 18px; color: var(--muted); line-height: 1.6; }

/* Chat */
.chat { position: sticky; top: 16px; align-self: start; background: var(--panel); border: 1px solid var(--panel-strong);
  border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; height: min(70vh, 680px); }
.chat-header { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: rgba(255,255,255,0.04); border-bottom: 1px solid var(--panel-strong); }
.pulse-dot { width: 10px; height: 10px; border-radius: 99px; background: var(--emerald); animation: pulse 2s infinite; }
@keyframes pulse { 0%{ box-shadow: 0 0 0 0 rgba(52,211,153,.6);} 70%{ box-shadow: 0 0 0 12px rgba(52,211,153,0);} 100%{ box-shadow: 0 0 0 0 rgba(52,211,153,0);} }
.chat-log { flex: 1; overflow: auto; padding: 12px; display: grid; gap: 10px; }
.msg { padding: 10px 12px; border-radius: 12px; max-width: 90%; }
.msg.user { background: rgba(96,165,250,0.15); border: 1px solid rgba(96,165,250,0.3); justify-self: end; }
.msg.bot { background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.28); }
.chat-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--panel-strong); }
.chat-input input { flex: 1; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--panel-strong); background: rgba(255,255,255,0.04); color: var(--text); }
.chat-input .send { padding: 10px 14px; border-radius: 12px; border: 1px solid var(--panel-strong); background: rgba(255,255,255,0.06); color: var(--text); cursor: pointer; }
.chat-input .send:hover { border-color: var(--accent); }

/* Footer */
.site-footer { text-align: center; padding: 24px 16px 40px; color: var(--muted); }

/* Accessibility */
.item summary:focus { outline: 3px solid rgba(125,211,252,0.4); outline-offset: 2px; }
