:root {
  --black: #000000;
  --white: #FFFFFF;
  --dim: rgba(255, 255, 255, 0.62);
  --faint: rgba(255, 255, 255, 0.38);
  --line: rgba(255, 255, 255, 0.14);
  --raise: rgba(255, 255, 255, 0.07);
  --beach: #5BC8EE;          /* South Beach blue, used only for accents */
  --beach-ink: #00131C;      /* text on the blue */
  --serif: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --sans: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --col: 720px;
  --gutter: 20px;
}

* { box-sizing: border-box; }
html { background: var(--black); }
body {
  margin: 0; min-height: 100svh; background: var(--black); color: var(--white);
  font-family: var(--sans); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column;
}
a { color: inherit; }
button, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--beach); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Top bar: small white wordmark, contact on the right */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px clamp(var(--gutter), 4vw, 40px);
  background: var(--black);
}
.top::after {
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 24px; pointer-events: none;
  background: linear-gradient(var(--black), transparent);
}
.logo { display: block; line-height: 0; border-radius: 2px; }
.mark {
  display: block; width: 104px; aspect-ratio: 1446 / 587; background: var(--white);
  -webkit-mask: url(assets/logo.png) center / contain no-repeat;
          mask: url(assets/logo.png) center / contain no-repeat;
}
.reach { display: flex; gap: 22px; font-size: 13px; color: var(--dim); }
.reach a { text-decoration: none; }
.reach a:hover { color: var(--white); }

main {
  flex: 1; width: 100%; max-width: calc(var(--col) + 2 * var(--gutter));
  margin: 0 auto; padding: 0 var(--gutter) 24px;
  display: flex; flex-direction: column;
}

/* Empty state */
.welcome { margin: auto 0; padding: 8vh 0 4vh; }
.welcome h1 {
  font-family: var(--serif); font-weight: 400; font-size: clamp(36px, 6vw, 56px);
  line-height: 1.1; margin: 0 0 16px; letter-spacing: -0.01em;
}
.welcome p { margin: 0 0 32px; color: var(--dim); max-width: 52ch; font-size: 17px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  padding: 10px 16px; font-size: 14px; color: var(--dim); cursor: pointer; text-align: left;
  transition: border-color .15s, color .15s;
}
.chip:hover { border-color: var(--beach); color: var(--white); }
body.chatting .welcome { display: none; }

/* Conversation */
.thread { list-style: none; margin: 0; padding: 16px 0 0; display: flex; flex-direction: column; gap: 28px; }
.msg { max-width: 100%; }
.msg.user {
  align-self: flex-end; max-width: 82%;
  background: var(--raise); border-radius: 20px 20px 6px 20px; padding: 12px 18px;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.msg.bot { display: grid; grid-template-columns: 22px 1fr; gap: 14px; align-items: start; }
.msg.bot::before {
  content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--beach);
  margin: 9px 0 0 6px;
}
.msg.bot .body p { margin: 0 0 12px; max-width: 64ch; }
.msg.bot .body p:last-child { margin-bottom: 0; }
.msg.bot strong { font-weight: 500; color: var(--white); }

.typing { display: inline-flex; gap: 5px; padding-top: 10px; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

/* Hand-off card offered once the visitor has described their brand */
.handoff {
  margin-top: 18px; border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px;
}
.handoff p { margin: 0; flex: 1 1 220px; color: var(--dim); font-size: 14px; }
.handoff .actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-block; border-radius: 999px; padding: 10px 18px; font-size: 14px;
  text-decoration: none; font-weight: 500; border: 1px solid var(--line);
}
.btn.primary { background: var(--beach); color: var(--beach-ink); border-color: var(--beach); }
.btn.primary:hover { background: var(--white); border-color: var(--white); }
.btn:not(.primary):hover { border-color: var(--white); }

/* Prompt dock */
.dock {
  position: sticky; bottom: 0; z-index: 5;
  padding: 12px var(--gutter) calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--black) 30%);
}
.prompt {
  max-width: var(--col); margin: 0 auto; display: flex; align-items: flex-end; gap: 6px;
  border: 1px solid var(--line); border-radius: 26px; padding: 8px 8px 8px 8px;
  background: var(--black); transition: border-color .15s;
}
.prompt:focus-within { border-color: rgba(91, 200, 238, 0.7); }
.prompt textarea {
  flex: 1; resize: none; border: 0; background: transparent; outline: none;
  padding: 9px 0; max-height: 180px; font-size: 16px; line-height: 1.5;
}
.prompt textarea::placeholder { color: var(--faint); }
.prompt button {
  flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--beach); color: var(--beach-ink); display: grid; place-items: center;
  transition: opacity .15s, background .15s;
}
.prompt button:hover:not(:disabled) { background: var(--white); }
.prompt button:disabled { opacity: .28; cursor: default; }
.prompt .attach {
  background: transparent; color: var(--dim); width: 40px; height: 40px;
}
.prompt .attach:hover:not(:disabled) { background: var(--raise); color: var(--white); }

/* Attachment chips: waiting to send (tray) and inside sent messages */
.tray { max-width: var(--col); margin: 0 auto 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.tray[hidden] { display: none; }
.file-chip {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: 13px;
  color: var(--white); text-decoration: none; background: var(--black);
}
.file-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.file-chip::before {
  content: ""; flex: none; width: 8px; height: 8px; border-radius: 2px; background: var(--beach);
}
.file-chip.uploading { color: var(--dim); }
.file-chip.uploading::before { background: var(--faint); }
.file-chip.error { border-color: rgba(255, 120, 120, 0.5); color: #FFB4B4; }
.file-chip.error::before { background: #FF8A8A; }
.file-chip .remove {
  background: none; border: 0; color: var(--faint); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px;
}
.file-chip .remove:hover { color: var(--white); }
.sent-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.msg.user .sent-files:first-child { margin-top: 0; }
.msg.user .file-chip { background: transparent; }
a.file-chip { display: inline-block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px; }
a.file-chip::before { display: inline-block; margin-right: 8px; vertical-align: middle; }
a.file-chip:hover { border-color: var(--beach); }

.fine { max-width: var(--col); margin: 10px auto 0; text-align: center; font-size: 12px; color: var(--faint); }

@media (max-width: 600px) {
  .reach a:first-child { display: none; }
  .mark { width: 88px; }
  .msg.user { max-width: 90%; }
  .msg.bot { grid-template-columns: 14px 1fr; gap: 10px; }
  .msg.bot::before { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .typing span { animation: none; opacity: .6; }
}
