:root {
  --ink: #12221f;
  --mute: #3d524c;
  --paper: #e8f0ea;
  --foam: #f4faf6;
  --teal: #1a5c52;
  --teal-deep: #0d3530;
  --glow: #7eb8a8;
  --accent: #c4784a;
  --line: rgba(18, 34, 31, 0.12);
  --shadow: 0 24px 60px rgba(13, 53, 48, 0.18);
  --radius: 22px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Outfit", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--teal-deep);
  overflow-x: hidden;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 55% at 15% 10%, rgba(126, 184, 168, 0.35), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 80%, rgba(196, 120, 74, 0.18), transparent 50%),
    linear-gradient(165deg, #0d3530 0%, #163f39 42%, #1a4a42 100%);
  animation: drift 18s ease-in-out infinite alternate;
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
  opacity: 0.5;
  pointer-events: none;
}

@keyframes drift {
  from { filter: hue-rotate(0deg); }
  to { filter: hue-rotate(8deg); }
}

.shell {
  position: relative;
  z-index: 1;
  width: min(720px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.5rem 0 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-height: 100vh;
}

.brand {
  text-align: center;
  animation: rise 0.9s ease both;
}

.eyebrow {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(244, 250, 246, 0.65);
  font-weight: 500;
}

.brand h1 {
  margin: 0.35rem 0 0.4rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.4rem, 12vw, 5.2rem);
  line-height: 0.95;
  color: var(--foam);
  letter-spacing: -0.02em;
  text-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
}

.tagline {
  margin: 0;
  color: rgba(232, 240, 234, 0.82);
  font-weight: 300;
  font-size: 1.05rem;
}

.who-gate,
.chat-panel {
  background: rgba(244, 250, 246, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  animation: rise 1s ease 0.12s both;
}

.who-gate {
  padding: 1.6rem 1.4rem 1.5rem;
  text-align: center;
}

.who-label {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--teal-deep);
}

.who-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
}

.who-btn {
  appearance: none;
  border: 1.5px solid var(--line);
  background: var(--foam);
  color: var(--teal);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1rem;
  padding: 0.75rem 1.35rem;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.who-btn:hover {
  transform: translateY(-2px);
  border-color: var(--teal);
  background: #dff0e8;
}

.chat-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: min(70vh, 640px);
  padding: 1rem 1rem 1.1rem;
  gap: 0.75rem;
}

.chat-panel.hidden,
.who-gate.hidden {
  display: none;
}

.chat-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--mute);
  padding: 0.2rem 0.35rem;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--glow);
  box-shadow: 0 0 0 4px rgba(126, 184, 168, 0.25);
  animation: pulse 2.4s ease infinite;
}

@keyframes pulse {
  50% { opacity: 0.45; }
}

.messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.4rem 0.2rem 0.8rem;
  scroll-behavior: smooth;
}

.bubble {
  max-width: 88%;
  padding: 0.85rem 1.05rem;
  border-radius: 18px;
  line-height: 1.45;
  font-size: 1rem;
  animation: rise 0.35s ease both;
}

.bubble.adassa {
  align-self: flex-start;
  background: linear-gradient(160deg, #d8ebe4, #eef6f1);
  color: var(--ink);
  border-bottom-left-radius: 6px;
}

.bubble.user {
  align-self: flex-end;
  background: var(--teal);
  color: var(--foam);
  border-bottom-right-radius: 6px;
}

.bubble .who {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.65;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.composer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.5rem;
  align-items: center;
  padding-top: 0.35rem;
  border-top: 1px solid var(--line);
}

.composer input {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 0.85rem 1.1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--foam);
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s ease;
}

.composer input:focus {
  border-color: var(--teal);
}

.send-btn,
.mic-btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
}

.send-btn {
  background: var(--teal-deep);
  color: var(--foam);
  font-weight: 500;
  padding: 0.85rem 1.15rem;
  border-radius: 999px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.send-btn:hover {
  background: var(--teal);
  transform: translateY(-1px);
}

.send-btn:disabled,
.mic-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

.mic-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #dff0e8;
  display: grid;
  place-items: center;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.mic-btn.recording {
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(196, 120, 74, 0.25);
  animation: pulse 1.2s ease infinite;
}

.mic-icon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--teal-deep);
  box-shadow: 0 0 0 3px rgba(13, 53, 48, 0.15);
}

.mic-btn.recording .mic-icon {
  background: var(--foam);
  box-shadow: none;
}

.hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--mute);
  text-align: center;
}

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

@media (max-width: 520px) {
  .composer {
    grid-template-columns: auto 1fr;
  }
  .send-btn {
    grid-column: 1 / -1;
  }
}
