:root {
  --ink: #171614;
  --ink-soft: #3f3b34;
  --parchment: #ebe6dc;
  --parchment-deep: #ddd6c8;
  --panel: rgba(252, 250, 245, 0.78);
  --line: rgba(55, 50, 42, 0.14);
  --muted: #6a645a;
  --forest: #2a463b;
  --forest-deep: #1b322a;
  --brass: #7d6a4a;
  --danger: #9b3d32;
  --success: #2f6b4f;
  --listening: #2c4a3e;
  --speaking: #8a5a28;
  --shadow: 0 18px 50px rgba(26, 24, 20, 0.08);
  --font-display: "Cormorant Garamond", "Times New Roman", serif;
  --font-body: "Outfit", "Avenir Next", sans-serif;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
}

body.demo {
  min-height: 100vh;
  color: var(--ink);
  background: var(--parchment);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.5;
  overflow-x: hidden;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.atmosphere-wash {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 60% at 50% -10%, #fff8ec 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 100% 80%, rgba(44, 74, 62, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 40% 35% at 0% 70%, rgba(154, 123, 79, 0.1) 0%, transparent 45%),
    linear-gradient(180deg, var(--parchment) 0%, var(--parchment-deep) 100%);
}

.atmosphere-grain {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  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='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.45'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.atmosphere-arch {
  position: absolute;
  left: 50%;
  top: 8%;
  width: min(920px, 110vw);
  height: min(520px, 70vh);
  transform: translateX(-50%);
  border: 1px solid rgba(58, 52, 44, 0.08);
  border-radius: 999px 999px 40% 40%;
  opacity: 0.55;
  animation: arch-breathe 10s ease-in-out infinite;
}

@keyframes arch-breathe {
  0%,
  100% {
    transform: translateX(-50%) scale(1);
    opacity: 0.45;
  }
  50% {
    transform: translateX(-50%) scale(1.02);
    opacity: 0.7;
  }
}

.topbar,
.stage,
.foot {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  max-width: 920px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 0;
  animation: rise 0.8s ease both;
}

.mark {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.demo-chip {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--forest);
  border-bottom: 1px solid rgba(44, 74, 62, 0.35);
  padding-bottom: 0.15rem;
}

.stage {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

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

.brand {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(3.4rem, 11vw, 5.6rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.lede {
  margin: 1.15rem auto 0;
  max-width: 28rem;
  font-size: 1.05rem;
  font-weight: 300;
  color: var(--ink-soft);
  line-height: 1.55;
}

.call-stage {
  margin-top: 2.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.status-row {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1.35rem;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.status-dot.connecting {
  background: var(--brass);
  animation: pulse 1.2s ease-in-out infinite;
}

.status-dot.connected {
  background: var(--success);
}

.status-dot.disconnected {
  background: rgba(155, 61, 50, 0.75);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.talk-button {
  position: relative;
  width: 11.5rem;
  height: 11.5rem;
  border-radius: 50%;
  border: 1px solid rgba(26, 24, 20, 0.18);
  background:
    radial-gradient(circle at 35% 28%, #fffdf8 0%, #f3ead8 42%, #e2d4bc 100%);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  animation: orb-idle 4.5s ease-in-out infinite;
}

.talk-button:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.02);
  border-color: var(--forest);
}

.talk-button:focus-visible {
  outline: 2px solid var(--forest);
  outline-offset: 4px;
}

.talk-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  animation: none;
}

.talk-button.active {
  border-color: var(--forest);
  animation: none;
}

.talk-button.listening {
  border-color: var(--listening);
}

.talk-button.speaking {
  border-color: var(--speaking);
}

.talk-rings {
  position: absolute;
  inset: -12%;
  pointer-events: none;
}

.talk-rings span {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid transparent;
  opacity: 0;
}

.talk-button.listening .talk-rings span,
.talk-button.speaking .talk-rings span {
  animation: ring-out 2.2s ease-out infinite;
}

.talk-button.listening .talk-rings span {
  border-color: rgba(44, 74, 62, 0.35);
}

.talk-button.speaking .talk-rings span {
  border-color: rgba(138, 90, 40, 0.35);
}

.talk-rings span:nth-child(2) {
  animation-delay: 0.55s;
}

.talk-rings span:nth-child(3) {
  animation-delay: 1.1s;
}

@keyframes ring-out {
  0% {
    transform: scale(0.85);
    opacity: 0.55;
  }
  100% {
    transform: scale(1.2);
    opacity: 0;
  }
}

@keyframes orb-idle {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

.mic-glyph {
  display: grid;
  place-items: center;
  color: var(--forest-deep);
  transition: color 0.2s ease;
}

.talk-button.speaking .mic-glyph {
  color: var(--speaking);
}

.talk-label {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hint {
  margin: 1.25rem 0 0;
  max-width: 22rem;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 300;
}

.enable-audio-banner {
  margin-top: 1.25rem;
  padding: 1rem 1.15rem;
  max-width: 18rem;
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.enable-audio-banner p {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.enable-audio-banner button {
  border: 1px solid var(--forest);
  background: var(--forest);
  color: #f7f1e6;
  padding: 0.55rem 0.95rem;
  font: inherit;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.enable-audio-banner button:hover,
.enable-audio-banner .banner-action:hover {
  background: var(--forest-deep);
}

.enable-audio-banner .banner-action {
  display: inline-block;
  border: 1px solid var(--forest);
  background: var(--forest);
  color: #f7f1e6;
  padding: 0.55rem 0.95rem;
  font: inherit;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.remote-audio {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.conversation {
  margin-top: 3.5rem;
  opacity: 0.55;
  transition: opacity 0.45s ease;
}

.conversation.has-messages {
  opacity: 1;
}

.conversation-rule {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(58, 52, 44, 0.28),
    transparent
  );
  margin-bottom: 1.5rem;
}

.conversation-title,
.slip-title {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.transcript {
  min-height: 8rem;
  max-height: 22rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-right: 0.25rem;
}

.message {
  max-width: 88%;
  padding: 0;
  line-height: 1.5;
  animation: message-in 0.35s ease both;
}

.message.user {
  align-self: flex-end;
  text-align: right;
}

.message.assistant {
  align-self: flex-start;
}

.message .label {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass);
}

.message.user .label {
  color: var(--forest);
}

.message > div:not(.label) {
  font-size: 1.02rem;
  color: var(--ink);
}

@keyframes message-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.booking-slip {
  margin-top: 2.75rem;
  padding: 1.35rem 1.4rem 1.45rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brass);
  backdrop-filter: blur(10px);
  animation: rise 1s 0.15s ease both;
}

.appointment-details p {
  margin: 0.3rem 0;
  font-size: 0.98rem;
}

.appointment-details strong {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
}

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

.foot {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 1.5rem 2.5rem;
  text-align: center;
}

.foot p {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

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

@media (max-width: 640px) {
  .topbar {
    padding-top: 1.15rem;
  }

  .stage {
    padding-top: 1.75rem;
  }

  .talk-button {
    width: 10rem;
    height: 10rem;
  }

  .lede {
    font-size: 0.98rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
