/* meet-my-ai — dark, AI-forward redesign (ported from Google Stitch).
   Glassmorphism + electric-blue→violet accents. No build step, no CDN. */

:root {
  --bg: #0a0a0f;
  --surface: #12131a;
  --surface-low: #1a1b22;
  --on-surface: #e3e1ec;
  --on-surface-variant: #c3c5d7;
  --outline: #8d90a0;
  --primary: #4f7cff;
  --violet: #8b5cf6;
  --primary-soft: #b5c4ff;
  --error: #ffb4ab;
  --glass-bg: rgba(18, 19, 26, 0.6);
  --glass-border: rgba(255, 255, 255, 0.1);
  --radius: 16px;
  --maxw: 800px;
}

* { box-sizing: border-box; margin: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--on-surface);
  min-height: 100dvh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Ambient background orb */
.bg-orb {
  position: fixed;
  top: 40%; left: 50%;
  width: 620px; height: 620px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at center,
              rgba(79, 124, 255, 0.28) 0%,
              rgba(139, 92, 246, 0.18) 40%,
              transparent 70%);
  filter: blur(90px);
  z-index: -1;
  pointer-events: none;
  animation: orb-drift 14s ease-in-out infinite alternate;
}
@keyframes orb-drift {
  0%   { transform: translate(-50%, -50%) scale(1); opacity: 0.85; }
  100% { transform: translate(-46%, -54%) scale(1.12); opacity: 1; }
}

/* Glass utility */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
}

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 10, 15, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto;
  height: 60px; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: "Geist", sans-serif; font-weight: 700; font-size: 0.72rem;
  color: #fff;
  background: rgba(79, 124, 255, 0.15);
  border: 1px solid rgba(181, 196, 255, 0.35);
  box-shadow: 0 0 14px rgba(79, 124, 255, 0.35);
}
.brand-name {
  font-family: "Geist", sans-serif; font-weight: 700; font-size: 1.05rem;
  letter-spacing: -0.01em;
}

/* Status indicator */
.status { display: flex; align-items: center; gap: 8px; }
.status-text {
  font-family: "Geist", sans-serif; font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--on-surface-variant);
}
.dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--outline); display: inline-block; position: relative;
}
.dot.up      { background: #22c55e; box-shadow: 0 0 12px rgba(34, 197, 94, 0.7); }
.dot.up::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: #22c55e; opacity: 0.75; animation: ping 1.6s cubic-bezier(0,0,.2,1) infinite;
}
.dot.degraded { background: #f59e0b; box-shadow: 0 0 12px rgba(245, 158, 11, 0.6); }
.dot.down     { background: #ef4444; box-shadow: 0 0 12px rgba(239, 68, 68, 0.6); }
@keyframes ping {
  75%, 100% { transform: scale(2.2); opacity: 0; }
}

/* Page container */
.page {
  flex: 1;
  width: 100%; max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px 20px 24px;
  display: flex; flex-direction: column;
}

/* Hero */
.hero { text-align: center; margin-bottom: 32px; padding-top: 8px; }
.hero-name {
  font-family: "Geist", sans-serif; font-weight: 700;
  font-size: clamp(2.2rem, 6vw, 3.4rem); line-height: 1.05;
  letter-spacing: -0.03em;
}
.hero-title {
  font-family: "Geist", sans-serif; font-weight: 600;
  font-size: clamp(1.15rem, 3vw, 1.5rem); margin-top: 6px;
  background: linear-gradient(135deg, var(--primary-soft) 0%, var(--violet) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub {
  color: var(--on-surface-variant); font-size: 1rem; margin-top: 12px;
}

/* Chat log */
.chat-log {
  flex: 1;
  display: flex; flex-direction: column; gap: 18px;
  min-height: 220px;
  padding: 8px 0 4px;
  overflow-y: auto;
}

/* Message rows */
.bubble-row { display: flex; flex-direction: column; max-width: 100%; }
.bubble-row.user { align-items: flex-end; }
.bubble-row.assistant { align-items: flex-start; }

.assistant-wrap { display: flex; gap: 12px; align-items: flex-start; max-width: 92%; }
.ai-avatar {
  width: 36px; height: 36px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center;
  background: rgba(79, 124, 255, 0.12);
  border: 1px solid rgba(181, 196, 255, 0.25);
  box-shadow: 0 0 16px -4px rgba(79, 124, 255, 0.5);
  color: var(--primary-soft);
}
.ai-avatar svg { width: 18px; height: 18px; }

/* Bubbles */
.bubble {
  padding: 14px 18px;
  border-radius: var(--radius);
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 1rem; line-height: 1.55;
  animation: bubble-in 0.45s ease both;
}
.bubble.user {
  background: linear-gradient(135deg, var(--primary) 0%, var(--violet) 100%);
  color: #fff;
  border-top-right-radius: 4px;
  max-width: 85%;
  box-shadow: 0 8px 30px -8px rgba(79, 124, 255, 0.5);
}
.bubble.assistant {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-left: 2px solid rgba(79, 124, 255, 0.6);
  border-top-left-radius: 4px;
  color: var(--on-surface);
}
.bubble.error {
  border-color: rgba(255, 100, 90, 0.5);
  border-left-color: #ef4444;
  color: var(--error);
}

/* Rendered Markdown inside assistant bubbles — tight, bubble-friendly spacing */
.bubble p { margin: 0 0 0.6em; }
.bubble p:last-child { margin-bottom: 0; }
.bubble ul, .bubble ol { margin: 0.3em 0 0.6em; padding-left: 1.3em; }
.bubble ul:last-child, .bubble ol:last-child { margin-bottom: 0; }
.bubble li { margin: 0.15em 0; }
.bubble strong { font-weight: 600; color: #fff; }
.bubble code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 5px; padding: 0.1em 0.35em;
}
@keyframes bubble-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Typing indicator (shown while awaiting first token) */
.typing { display: inline-flex; gap: 5px; align-items: center; padding: 2px 0; }
.typing span {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--primary-soft);
  animation: typing-bounce 1.2s ease-in-out infinite;
}
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30%           { transform: translateY(-5px); opacity: 1; }
}

/* Starter chips */
.starters {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center;
  margin: 18px 0;
}
.chip {
  padding: 9px 16px; border-radius: 999px;
  font-family: "Geist", sans-serif; font-size: 0.82rem; font-weight: 500;
  color: var(--primary-soft);
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(181, 196, 255, 0.22);
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
}
.chip:hover:not(:disabled) {
  background: rgba(79, 124, 255, 0.14);
  box-shadow: 0 0 18px -4px rgba(79, 124, 255, 0.5);
  transform: translateY(-1px);
}
.chip:disabled { opacity: 0.45; cursor: default; }

/* Composer */
.composer {
  position: sticky; bottom: 16px;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 8px 8px 20px;
  border-radius: 999px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7),
              0 0 30px -10px rgba(79, 124, 255, 0.25);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.composer:focus-within {
  border-color: rgba(79, 124, 255, 0.5);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7),
              0 0 34px -8px rgba(79, 124, 255, 0.4);
}
#chat-input {
  flex: 1; min-width: 0;
  background: transparent; border: none; outline: none;
  color: var(--on-surface); font-size: 1rem;
  font-family: "Inter", sans-serif;
}
#chat-input::placeholder { color: rgba(141, 144, 160, 0.6); }
.char-counter {
  font-family: "Geist", sans-serif; font-size: 0.72rem; letter-spacing: 0.03em;
  color: rgba(141, 144, 160, 0.7); white-space: nowrap;
}
.char-counter.near-limit { color: var(--error); font-weight: 600; }
.send-btn {
  width: 46px; height: 46px; flex-shrink: 0;
  border: none; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--violet) 100%);
  transition: box-shadow 0.25s, transform 0.15s;
}
.send-btn:hover:not(:disabled) {
  box-shadow: 0 0 24px rgba(79, 124, 255, 0.55);
  transform: scale(1.05);
}
.send-btn:active:not(:disabled) { transform: scale(0.96); }
.send-btn:disabled { opacity: 0.5; cursor: default; }

/* Footer */
.site-footer {
  margin-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: #0d0e15;
}
.footer-inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: 22px 20px;
  font-size: 0.78rem; color: rgba(141, 144, 160, 0.85);
}
.how summary {
  cursor: pointer; font-family: "Geist", sans-serif; font-weight: 500;
  color: var(--on-surface-variant); margin-bottom: 6px;
}
.how p { line-height: 1.6; }
.how a { color: var(--primary-soft); }

/* Code-access request */
.code-access { margin-top: 16px; }
.code-access-label { color: var(--on-surface-variant); margin-bottom: 8px; }
.access-form { display: flex; gap: 8px; flex-wrap: wrap; max-width: 420px; }
#access-email {
  flex: 1; min-width: 180px;
  padding: 9px 14px; border-radius: 999px;
  background: var(--glass-bg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--on-surface); font-family: "Inter", sans-serif; font-size: 0.85rem;
  outline: none;
}
#access-email::placeholder { color: rgba(141, 144, 160, 0.55); }
#access-email:focus { border-color: rgba(79, 124, 255, 0.5); }
#access-btn {
  padding: 9px 18px; border: none; border-radius: 999px; cursor: pointer;
  font-family: "Geist", sans-serif; font-size: 0.82rem; font-weight: 500; color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--violet) 100%);
  transition: box-shadow 0.2s, transform 0.15s;
}
#access-btn:hover:not(:disabled) {
  box-shadow: 0 0 18px rgba(79, 124, 255, 0.5); transform: translateY(-1px);
}
#access-btn:disabled { opacity: 0.55; cursor: default; }
.access-msg { margin-top: 8px; font-size: 0.8rem; min-height: 1.1em; }
.access-msg.ok  { color: #4ade80; }
.access-msg.err { color: var(--error); }

.disclosure { margin-top: 16px; color: rgba(141, 144, 160, 0.7); }

/* Small screens */
@media (max-width: 520px) {
  .page { padding: 24px 16px 16px; }
  .composer { bottom: 10px; }
  .char-counter { display: none; }  /* keep composer uncluttered on phones */
}
