:root {
  --green: #2a7d6e;
  --green-dark: #1f5f53;
  --green-deep: #122e29;
  --fog: #dceee9;
  --mist: #cfe6df;
  --pale: #9fc4b8;
  --text: #122e29;
  --muted: #3a5c54;
  --on-dark: #e7f5f0;
  --sand: #f3eee6;
  --sand-ink: #3a3228;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, #eaf6f2 0%, transparent 55%),
    linear-gradient(180deg, var(--fog) 0%, var(--sand) 100%);
}

.chat-page {
  max-width: 28rem;
  margin: 0 auto;
  padding: 1.75rem 1.15rem 3rem;
}

.chat-label {
  margin: 0 0 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
}

.chat-title {
  margin: 0 0 0.4rem;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: clamp(1.5rem, 5vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--green-deep);
  line-height: 1.2;
}

.chat-sub {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.chat-shell {
  background: #fff;
  border-radius: 18px;
  border: 1px solid rgba(18, 46, 41, 0.08);
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(18, 46, 41, 0.08);
}

.chat-shell__bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1rem;
  background: var(--green-deep);
  color: var(--on-dark);
}

.chat-shell__dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #7dcea0;
  box-shadow: 0 0 0 4px rgba(125, 206, 160, 0.25);
  animation: pulse 2.4s ease-in-out infinite;
}

.chat-shell__name {
  font-size: 0.8125rem;
  font-weight: 600;
}

.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.15rem 1rem 1.35rem;
  background: linear-gradient(180deg, #f7faf8 0%, #fff 40%);
  min-height: 22rem;
}

.bubble {
  max-width: 88%;
  opacity: 0;
  transform: translateY(10px);
  animation: rise-in 0.55s ease forwards;
  animation-delay: var(--d, 0s);
}

.bubble p {
  margin: 0;
  padding: 0.7rem 0.9rem;
  font-size: 0.9375rem;
  line-height: 1.45;
  border-radius: 16px;
}

.bubble__who {
  display: block;
  margin: 0 0 0.25rem 0.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.65;
}

.bubble--them {
  align-self: flex-start;
}

.bubble--them p {
  background: var(--sand);
  color: var(--sand-ink);
  border-bottom-left-radius: 5px;
}

.bubble--john {
  align-self: flex-end;
}

.bubble--john .bubble__who {
  text-align: right;
  margin-right: 0.35rem;
}

.bubble--john p {
  background: var(--green);
  color: var(--on-dark);
  border-bottom-right-radius: 5px;
}

.bubble--cta {
  max-width: 92%;
}

.bubble--cta p {
  border-bottom-right-radius: 16px;
  margin-bottom: 0.55rem;
}

.chat-call {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: var(--green-deep);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: background 0.15s ease, transform 0.15s ease;
}

.chat-call:hover {
  background: #0c1f1b;
  transform: translateY(-1px);
}

.chat-back {
  margin: 1.5rem 0 0;
  text-align: center;
  font-size: 0.875rem;
}

.chat-back a {
  color: var(--muted);
  text-decoration: none;
}

.chat-back a:hover {
  color: var(--green-deep);
  text-decoration: underline;
}

@keyframes rise-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 4px rgba(125, 206, 160, 0.2);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(125, 206, 160, 0.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bubble {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .chat-shell__dot {
    animation: none;
  }
}
