@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600&family=Sora:wght@500;600;700&display=swap");

* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #0c0f1f;
  --bg-2: #151730;
  --panel: rgba(19, 21, 39, 0.92);
  --stroke: rgba(255, 255, 255, 0.08);
  --text: #f8fafc;
  --muted: rgba(226, 232, 240, 0.6);
  --accent: #a855f7;
  --accent-2: #66e6ff;
  --glow: rgba(168, 85, 247, 0.5);
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 15% 0%, rgba(102, 230, 255, 0.2), transparent 45%),
    radial-gradient(circle at 85% 0%, rgba(168, 85, 247, 0.22), transparent 45%),
    linear-gradient(160deg, var(--bg), var(--bg-2));
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 18px;
  overflow: hidden;
}

.shell {
  width: min(720px, 100%);
  display: grid;
  gap: 20px;
  min-height: 100dvh;
  grid-template-rows: auto 1fr;
}

.brand {
  display: grid;
  gap: 6px;
}

.overline {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: 11px;
  color: var(--muted);
}

h1 {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: clamp(30px, 5vw, 44px);
}

.subtitle {
  margin: 0;
  color: var(--muted);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 30px;
  padding: 26px;
  box-shadow: 0 30px 80px rgba(5, 8, 20, 0.6);
  backdrop-filter: blur(24px);
}

body[data-auth="in"] #auth-panel {
  display: none;
}

body[data-auth="out"] #assistant-panel {
  display: none;
}

.panel h2 {
  margin-top: 0;
  font-family: "Sora", sans-serif;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--muted);
}

input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.8);
  color: var(--text);
  font-size: 16px;
}

button {
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.primary {
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: white;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 14px 30px rgba(124, 58, 237, 0.35);
}

.primary:hover {
  transform: translateY(-1px);
}

.ghost {
  background: rgba(15, 23, 42, 0.55);
  color: var(--muted);
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.status {
  min-height: 20px;
  color: var(--accent-2);
}

.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.chip {
  background: rgba(168, 85, 247, 0.18);
  color: #e9d5ff;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.icon {
  background: rgba(15, 23, 42, 0.7);
  color: var(--muted);
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 8px 14px;
  border-radius: 999px;
}

.core {
  display: grid;
  place-items: center;
  gap: 14px;
  padding: 12px 0 22px;
}

.orb-core {
  width: min(260px, 72vw);
  aspect-ratio: 1;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.12), transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(168, 85, 247, 0.22), transparent 65%);
  padding: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  touch-action: manipulation;
  position: relative;
  box-shadow: 0 40px 80px rgba(88, 28, 135, 0.55);
  overflow: hidden;
}

.orb-core:hover {
  transform: translateY(-1px) scale(1.01);
}

.orb-core:active {
  transform: scale(0.98);
}

.orb-core:focus-visible {
  outline: 2px solid rgba(102, 230, 255, 0.8);
  outline-offset: 6px;
}

.orb-wave {
  position: absolute;
  inset: 18px;
  border-radius: 999px;
  border: 1px solid rgba(168, 85, 247, 0.6);
  opacity: 0.8;
  animation: pulse 4.6s ease-in-out infinite;
}

.orb-wave-2 {
  inset: 32px;
  border-color: rgba(102, 230, 255, 0.55);
  animation-delay: 1.5s;
}

.prompt {
  text-align: center;
}

.prompt-hello {
  margin: 0;
  font-size: 16px;
  color: var(--muted);
}

.prompt-action {
  margin: 6px 0 0;
  font-family: "Sora", sans-serif;
  font-size: 18px;
}

.dialog {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.dialog h3 {
  margin-bottom: 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.dialog p {
  margin: 0;
  background: rgba(15, 23, 42, 0.7);
  border-radius: 18px;
  padding: 14px 18px;
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

.mic {
  background: linear-gradient(140deg, #a855f7, #6d28d9 60%, #4c1d95);
  color: white;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 20px 45px rgba(88, 28, 135, 0.6);
}

.memory {
  margin-top: 16px;
  color: var(--muted);
  display: grid;
  gap: 10px;
}

.memory-item {
  background: rgba(15, 23, 42, 0.75);
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

a {
  color: #d8b4fe;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.hidden {
  display: none;
}

.muted {
  color: var(--muted);
}

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

@media (max-width: 720px) {
  body {
    padding: 0;
  }
  .panel.assistant {
    padding: calc(14px + env(safe-area-inset-top)) 16px calc(18px + env(safe-area-inset-bottom));
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    height: 100%;
    display: grid;
    grid-template-rows: auto auto 1fr auto auto;
    gap: 10px;
    min-height: 0;
  }
  .panel.auth {
    padding: calc(18px + env(safe-area-inset-top)) 16px;
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
  }
  .shell {
    width: 100%;
    gap: 16px;
    height: 100svh;
    padding: 0;
  }
  .orb-core {
    width: min(200px, 62vw);
  }
  .core {
    padding: 4px 0 10px;
    gap: 10px;
  }
  .prompt-hello {
    font-size: 14px;
  }
  .prompt-action {
    font-size: 16px;
  }
  .dialog {
    gap: 8px;
    margin-bottom: 6px;
  }
  .dialog h3 {
    font-size: 10px;
    letter-spacing: 0.18em;
  }
  .dialog p {
    padding: 10px 12px;
    font-size: 13px;
  }
  .controls {
    gap: 10px;
  }
  .memory {
    max-height: 18vh;
    overflow: auto;
  }
}
