/* Colors and fonts follow the Bridge site (lumerapath-site/app/globals.css). */
:root {
  --cream: #faf6ee;
  --cream-deep: #f4ecdd;
  --sand: #ede2cc;
  --navy-950: #0a1223;
  --navy-900: #0f1c36;
  --navy-800: #16264a;
  --gold-300: #e3c68c;
  --gold-400: #d4ab5f;
  --gold-500: #c3922e;
  --gold-600: #a97c26;
  --gold-700: #8a6420;
  --ink: #232a38;
  --ink-soft: #4c5568;
  --display: "Cormorant Garamond", Georgia, serif;
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

.app {
  display: flex;
  flex-direction: column;
  max-width: 44rem;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
}

/* Header */

.header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: calc(0.75rem + env(safe-area-inset-top)) 1.25rem 0.75rem;
  border-bottom: 1px solid var(--sand);
}

.emblem {
  flex: none;
  border-radius: 50%;
}

.title {
  flex: 1;
  min-width: 0;
}

.title h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--navy-900);
}

.title p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.new-chat {
  flex: none;
  padding: 0.45rem 1rem;
  border: 1px solid rgb(18 32 63 / 0.25);
  border-radius: 9999px;
  background: transparent;
  color: var(--navy-900);
  font: 600 0.85rem var(--sans);
  cursor: pointer;
}

.new-chat:hover {
  border-color: var(--gold-500);
  color: var(--gold-700);
}

/* Framed in lumerapath.com/chat/ under the site's header: no emblem or title, just a slim bar for "New chat". */
.embedded .header {
  display: none;
  justify-content: flex-end;
  padding: 0.5rem 1.25rem;
}

.embedded .header.shown {
  display: flex;
}

.embedded .emblem,
.embedded .title {
  display: none;
}

/* Messages */

.messages {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.25rem;
}

.message {
  display: flex;
  margin-bottom: 1rem;
}

.message.user {
  justify-content: flex-end;
}

.bubble {
  max-width: 88%;
  padding: 0.8rem 1.05rem;
  border-radius: 1.1rem;
  overflow-wrap: anywhere;
}

.assistant .bubble {
  background: #fff;
  border: 1px solid var(--sand);
  border-bottom-left-radius: 0.35rem;
}

.user .bubble {
  background: var(--navy-900);
  color: var(--cream);
  border-bottom-right-radius: 0.35rem;
  white-space: pre-wrap;
}

.error .bubble {
  background: var(--cream-deep);
  color: var(--ink-soft);
}

.bubble p,
.bubble ul,
.bubble ol {
  margin: 0 0 0.6rem;
}

.bubble > :last-child {
  margin-bottom: 0;
}

.bubble ul,
.bubble ol {
  padding-left: 1.25rem;
}

.bubble a {
  color: var(--gold-700);
  text-decoration-color: var(--gold-400);
  text-underline-offset: 2px;
}

.typing {
  display: inline-flex;
  gap: 0.3rem;
  padding: 0.35rem 0;
}

.typing span {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--gold-400);
  animation: pulse 1.2s infinite ease-in-out;
}

.typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes pulse {
  0%,
  80%,
  100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Suggested questions */

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.25rem 0 1rem;
}

.suggestions button {
  padding: 0.55rem 1rem;
  border: 1px solid var(--gold-400);
  border-radius: 9999px;
  background: var(--cream);
  color: var(--navy-900);
  font: 500 0.9rem var(--sans);
  text-align: left;
  cursor: pointer;
}

.suggestions button:hover {
  background: var(--cream-deep);
  border-color: var(--gold-500);
}

/* Composer */

.footer {
  padding: 0.75rem 1.25rem calc(0.75rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--sand);
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  padding: 0.4rem 0.4rem 0.4rem 1rem;
  border: 1px solid var(--sand);
  border-radius: 1.5rem;
  background: #fff;
}

.composer:focus-within {
  border-color: var(--gold-400);
}

.composer textarea {
  flex: 1;
  min-height: 2.5rem;
  max-height: 8rem;
  padding: 0.5rem 0;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--ink);
  /* 16px or more keeps iPhones from zooming in on focus. */
  font: 1rem/1.5 var(--sans);
}

.composer button {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(120deg, #b98a33, var(--gold-400) 55%, #b98a33);
  color: var(--navy-950);
  cursor: pointer;
}

.composer button:disabled {
  opacity: 0.45;
  cursor: default;
}

.notice {
  margin: 0.6rem 0.25rem 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--ink-soft);
  text-align: center;
}

.notice a {
  color: var(--gold-700);
}

.noscript {
  padding: 1rem;
  text-align: center;
}

:focus-visible {
  outline: 2px solid var(--gold-500);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .typing span {
    animation: none;
  }
}
