/* ============================================================
   v6 — reactive voice orb + bold black glowing JARVIS logo.
   No HUD panels, no dashboard. Just the calm orb and chat.
   ============================================================ */

:root{
  --bg:#05080f;
  --panel:rgba(10,16,28,.72);
  --line:rgba(25,227,255,.18);
  --cyan:#19e3ff;
  --cyan-dim:rgba(25,227,255,.55);
  --text:#dCEefc;
  --muted:#7d93ad;
  --user:#11324a;
  --radius:16px;
  font-size:16px;
}

*{ box-sizing:border-box; -webkit-tap-highlight-color:transparent; }

html,body{ height:100%; margin:0; }

body{
  background:var(--bg);
  color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  display:flex; flex-direction:column;
  min-height:100dvh;
  overflow:hidden;
  position:relative;
  padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* ---- Reactive orb canvas, full-bleed behind everything ---- */
#orb{
  position:fixed; inset:0; width:100%; height:100%;
  z-index:0; display:block;
}

/* Bold glowing wordmark sitting over the orb's centre. */
.orb-logo{
  position:fixed; left:0; right:0; top:33%;
  transform:translateY(-50%);
  z-index:2; pointer-events:none; text-align:center;
  font-weight:900; letter-spacing:12px; font-size:40px;
  color:#02050b;
  text-shadow:
    0 0 1px #000,
    0 2px 6px rgba(0,0,0,.7),
    0 0 18px rgba(25,227,255,.7),
    0 0 38px rgba(25,227,255,.45),
    0 0 70px rgba(25,227,255,.25);
  opacity:.95;
  animation:logoBreathe 5s ease-in-out infinite;
}
@keyframes logoBreathe{
  0%,100%{ opacity:.88; letter-spacing:12px; }
  50%{ opacity:1; letter-spacing:14px; }
}
@media (max-width:420px){ .orb-logo{ font-size:30px; letter-spacing:8px; } }

/* ---- Top bar ---- */
.topbar{
  position:relative; z-index:3;
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 18px;
  background:linear-gradient(180deg,rgba(5,8,15,.85),rgba(5,8,15,0));
}
.brand{ display:flex; align-items:center; gap:10px; }
.dot{
  width:10px; height:10px; border-radius:50%;
  background:var(--cyan); box-shadow:0 0 10px var(--cyan);
  transition:background .3s, box-shadow .3s;
}
.dot.busy{ background:#ffb020; box-shadow:0 0 10px #ffb020; }
.titles h1{
  margin:0; font-size:15px; font-weight:700; letter-spacing:3px;
}
.subtitle{ font-size:11px; color:var(--muted); letter-spacing:1px; }

.icon-btn{
  background:rgba(25,227,255,.08);
  border:1px solid var(--line);
  color:var(--cyan);
  border-radius:12px;
  width:42px; height:42px;
  font-size:18px; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  transition:background .2s, transform .1s;
}
.icon-btn:active{ transform:scale(.92); }
.icon-btn:hover{ background:rgba(25,227,255,.16); }

/* ---- HUD state label over the orb ---- */
.state-label{
  position:relative; z-index:3;
  text-align:center; margin-top:4px;
  font-size:11px; letter-spacing:5px; color:var(--cyan-dim);
}

/* ---- Messages ---- */
.messages{
  position:relative; z-index:3;
  flex:1; overflow-y:auto;
  padding:18px 16px 8px;
  display:flex; flex-direction:column; gap:12px;
  scroll-behavior:smooth;
}
.msg{
  max-width:82%; padding:11px 14px;
  border-radius:var(--radius); line-height:1.45; font-size:15px;
  white-space:pre-wrap; word-wrap:break-word;
  animation:rise .25s ease;
}
@keyframes rise{ from{ opacity:0; transform:translateY(8px);} to{opacity:1;transform:none;} }
.msg.user{
  align-self:flex-end;
  background:var(--user);
  border:1px solid rgba(25,227,255,.25);
  border-bottom-right-radius:4px;
}
.msg.bot{
  align-self:flex-start;
  background:var(--panel);
  border:1px solid var(--line);
  border-bottom-left-radius:4px;
  backdrop-filter:blur(8px);
  cursor:pointer;
}

/* ---- Thinking dots ---- */
.thinking{
  position:relative; z-index:3;
  display:flex; gap:6px; padding:0 24px 6px;
}
.thinking.hidden{ display:none; }
.thinking span{
  width:8px; height:8px; border-radius:50%;
  background:var(--cyan); opacity:.4;
  animation:blink 1.2s infinite;
}
.thinking span:nth-child(2){ animation-delay:.2s; }
.thinking span:nth-child(3){ animation-delay:.4s; }
@keyframes blink{ 0%,100%{opacity:.25;} 50%{opacity:1;} }

/* ---- Composer ---- */
.composer{
  position:relative; z-index:3;
  display:flex; align-items:flex-end; gap:8px;
  padding:10px 14px calc(14px + env(safe-area-inset-bottom));
  background:linear-gradient(0deg,rgba(5,8,15,.92),rgba(5,8,15,0));
}
#input{
  flex:1; resize:none; max-height:120px;
  background:var(--panel);
  border:1px solid var(--line);
  color:var(--text);
  border-radius:14px;
  padding:12px 14px; font-size:15px;
  font-family:inherit; outline:none;
  backdrop-filter:blur(8px);
}
#input:focus{ border-color:var(--cyan-dim); }
.mic.recording{ background:#ff2d55; color:#fff; box-shadow:0 0 14px #ff2d55; }

/* ---- Settings sheet ---- */
.sheet{
  position:fixed; inset:0; z-index:10;
  background:rgba(2,5,11,.6); backdrop-filter:blur(4px);
  display:flex; align-items:flex-end; justify-content:center;
}
.sheet.hidden{ display:none; }
.sheet-card{
  width:100%; max-width:480px;
  background:#0a1019;
  border:1px solid var(--line);
  border-radius:20px 20px 0 0;
  padding:22px 20px calc(22px + env(safe-area-inset-bottom));
  animation:sheetUp .25s ease;
}
@keyframes sheetUp{ from{ transform:translateY(100%);} to{transform:none;} }
.sheet-card h2{ margin:0 0 16px; font-size:18px; letter-spacing:1px; }
.sheet-card label{
  display:block; margin:14px 0 6px; font-size:13px; color:var(--muted);
}
.sheet-card label.row{ display:flex; align-items:center; gap:8px; color:var(--text); }
.sheet-card input[type=password],
.sheet-card select{
  width:100%; padding:11px 12px;
  background:#05080f; color:var(--text);
  border:1px solid var(--line); border-radius:10px;
  font-size:15px; font-family:inherit; outline:none;
}
.hint{ font-size:11px; color:var(--muted); margin:6px 0 0; line-height:1.4; }
.sheet-actions{
  display:flex; gap:10px; margin-top:22px;
}
.sheet-actions button{
  flex:1; padding:13px; border-radius:12px;
  border:1px solid var(--line);
  background:var(--cyan); color:#02050b;
  font-size:15px; font-weight:700; cursor:pointer;
}
.sheet-actions .ghost{
  background:transparent; color:var(--text);
}
