/* ============================
   Relay - Live Demo
   Matches the marketing site: dark industrial theme,
   DM Serif Display + DM Sans, amber accent.
   ============================ */

:root {
  /* Colors */
  --bg: #0c0b09;
  --bg-surface: #171512;
  --bg-surface-2: #1f1d19;
  --accent: #e8a020;
  --accent-muted: rgba(232, 160, 32, 0.12);
  --accent-border: rgba(232, 160, 32, 0.3);
  --text: #f0ede8;
  --text-muted: rgba(240, 237, 232, 0.5);
  --text-faint: rgba(240, 237, 232, 0.25);
  --border: rgba(240, 237, 232, 0.08);
  --border-strong: rgba(240, 237, 232, 0.14);
  --ko-orange: #e8601c;
  --green: #4ade80;
  --red: #f87171;

  /* Fonts */
  --font-display: "DM Serif Display", Georgia, serif;
  --font-body: "DM Sans", system-ui, sans-serif;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 100px;

  --transition: 0.2s ease-in-out;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(
      1200px 700px at 75% -10%,
      rgba(232, 160, 32, 0.06),
      transparent 60%
    ),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================
   Brand header
   ============================ */
.demo-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.125rem 2.5rem;
  border-bottom: 1px solid var(--border);
}

.demo-logo {
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
  text-decoration: none;
}

.demo-logo-relay {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 400;
  color: var(--text);
  letter-spacing: -0.01em;
}

.demo-logo-by {
  font-size: 0.75rem;
  color: var(--text-faint);
}

.demo-nav-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-muted);
  color: var(--accent);
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.3125rem 0.875rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.75px;
  text-transform: uppercase;
  border: 1px solid var(--accent-border);
}

/* ============================
   Stage layout
   ============================ */
.stage {
  max-width: 1040px;
  margin: 0 auto;
  padding: 40px 24px 56px;
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

@media (max-width: 820px) {
  .demo-nav {
    padding: 1rem 1.5rem;
  }

  .stage {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 28px 18px 48px;
  }
}

/* ---- controls below the scenarios ---- */
.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  gap: 12px;
}

.ghost-btn {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 13px;
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.ghost-btn:hover {
  color: var(--accent);
  border-color: var(--accent-border);
}

/* ---- replay/live mode bar ---- */
.mode-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Small status pill: "Recorded demo" in replay, "Live - powered by Claude" when
   the engine is running. */
.mode-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.mode-tag::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
}
/* Live tag glows amber and pulses. */
.mode-bar:has(#goLive[hidden]) .mode-tag {
  color: var(--accent);
  border-color: var(--accent-border);
}
.mode-bar:has(#goLive[hidden]) .mode-tag::before {
  background: var(--accent);
  animation: mode-pulse 1.6s ease-in-out infinite;
}
@keyframes mode-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

/* Primary call to action: start a real conversation. */
.live-btn {
  background: var(--accent);
  color: #1a1408;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 13px;
  font-family: var(--font-body);
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}
.live-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.turnstile-slot {
  display: flex;
  justify-content: center;
  margin-top: 14px;
  min-height: 0;
}

/* ---- phone mockup ---- */
.phone {
  position: relative;
  background: var(--bg-surface);
  border-radius: 2rem;
  padding: 14px 12px 12px;
  border: 1.5px solid var(--border-strong);
  box-shadow:
    0 0 0 6px rgba(240, 237, 232, 0.03),
    0 32px 64px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  height: 620px;
}

.phone-notch {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 5rem;
  height: 0.375rem;
  background: var(--bg-surface-2);
  border-radius: var(--radius-full);
  z-index: 3;
}

.phone-header {
  text-align: center;
  padding: 22px 0 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.avatar {
  width: 46px;
  height: 46px;
  margin: 0 auto 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #c47e10);
  color: #0c0b09;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 16px;
}

.phone-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}

.phone-sub {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 2px;
}

.thread {
  flex: 1;
  overflow-y: auto;
  padding: 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: transparent;
  /* Firefox */
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

/* WebKit (Chrome/Safari/Edge) - match the phone's dark/amber theme */
.thread::-webkit-scrollbar {
  width: 6px;
}

.thread::-webkit-scrollbar-track {
  background: transparent;
}

.thread::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-full);
}

.thread::-webkit-scrollbar-thumb:hover {
  background: var(--accent-border);
}

.bubble {
  max-width: 80%;
  padding: 9px 13px;
  border-radius: 1rem;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
  animation: pop 0.2s ease;
}

@keyframes pop {
  from {
    transform: translateY(6px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

/* assistant (the business) - left, surface bubble */
.bubble.them {
  align-self: flex-start;
  background: var(--bg-surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 0.25rem;
}

/* customer (you) - right, amber bubble */
.bubble.me {
  align-self: flex-end;
  background: var(--accent);
  color: #0c0b09;
  border-bottom-right-radius: 0.25rem;
}

.typing {
  align-self: flex-start;
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: 1rem;
  border-bottom-left-radius: 0.25rem;
  padding: 12px 14px;
  display: inline-flex;
  gap: 4px;
}

.typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: blink 1.2s infinite ease-in-out;
}

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

@keyframes blink {
  0%,
  60%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.composer {
  display: flex;
  gap: 8px;
  padding: 10px 6px 4px;
  border-top: 1px solid var(--border);
  background: transparent;
}

.composer input {
  flex: 1;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-full);
  padding: 10px 14px;
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.composer input::placeholder {
  color: var(--text-faint);
}

.composer input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.composer input:disabled {
  background: var(--bg-surface);
  color: var(--text-muted);
}

.composer button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #0c0b09;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition);
}

.composer button:hover:not(:disabled) {
  background: #f0b030;
}

.composer button:disabled {
  background: var(--bg-surface-2);
  color: var(--text-faint);
  cursor: not-allowed;
}

/* ---- scenarios ---- */
.scenarios {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.scenarios-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  width: 100%;
  margin-bottom: 4px;
}

.chip {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-full);
  padding: 7px 14px;
  font-size: 12.5px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition);
}

.chip:hover {
  border-color: var(--accent-border);
  background: var(--accent-muted);
  color: var(--accent);
}

/* ---- right column layout ---- */
.panel-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Each right-column section is its own surface so the two steps of the story
   ("behind the scenes" and "the result") read as distinct, organized blocks
   instead of bleeding together. */
.panel-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 26px;
}

/* Amber kicker above each card title - keeps both sections on the same
   visual hierarchy. */
.panel-card-eyebrow {
  display: block;
  margin-bottom: 10px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.panel-card-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.375rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text);
}

/* ---- behind-the-scenes live activity feed ---- */
.activity-feed {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
}

.activity-empty {
  position: relative;
  padding: 2px 0 2px 28px;
  font-size: 13px;
  color: var(--text-faint);
}

.activity-empty::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
}

.activity-item {
  position: relative;
  padding: 0 0 18px 28px;
  animation: activity-in 0.3s ease;
}

.activity-item:last-child {
  padding-bottom: 0;
}

/* Step marker. */
.activity-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid var(--accent-border);
  z-index: 1;
}

/* Connector line down to the next step. */
.activity-item::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 15px;
  bottom: -3px;
  width: 2px;
  background: var(--border-strong);
}

.activity-item:last-child::after {
  display: none;
}

/* The newest step pulses to draw the eye to what just happened. */
.activity-item.is-latest::before {
  background: var(--accent);
  border-color: var(--accent);
  animation: activity-pulse 1.6s ease-in-out infinite;
}

@keyframes activity-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 3px var(--accent-muted);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(232, 160, 32, 0.16);
  }
}

.activity-text {
  display: block;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-muted);
}

.activity-item.is-latest .activity-text {
  color: var(--text);
}

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

/* ---- outcome / capture panel ---- */
.panel-tagline {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.7;
  max-width: 46ch;
}

/* The owner's phone: a lock-screen style push notification from Relay. */
.notify-stage {
  margin-bottom: 0;
}

.notify-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface-2);
  padding: 16px 18px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.notify-card.is-shown {
  animation: notify-in 0.35s ease;
}

@keyframes notify-in {
  from {
    transform: translateY(14px) scale(0.98);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* Pending state - before the conversation wraps up. */
.notify-pending {
  border-style: dashed;
  border-color: var(--border);
  background: transparent;
  box-shadow: none;
}

.notify-placeholder {
  font-size: 13px;
  color: var(--text-faint);
  text-align: center;
  padding: 12px 0;
}

/* Sender row: brand mark, name and timestamp like an iOS push. */
.notify-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.notify-app {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--bg);
  background: var(--accent);
}

.notify-from {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}

.notify-time {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-faint);
}

.notify-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}

.notify-icon {
  font-size: 17px;
  line-height: 1;
}

.notify-body {
  display: grid;
  gap: 4px;
}

.notify-line {
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
}

.notify-line:first-child {
  font-weight: 600;
}

.notify-line:not(:first-child) {
  color: var(--text-muted);
}

/* Color variants keyed to outcome. */
.notify-good {
  border-color: rgba(74, 222, 128, 0.3);
  background: rgba(74, 222, 128, 0.07);
}
.notify-good .notify-title {
  color: var(--green);
}

.notify-warn {
  border-color: var(--accent-border);
  background: var(--accent-muted);
}
.notify-warn .notify-title {
  color: var(--accent);
}

.notify-danger {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.08);
}
.notify-danger .notify-title {
  color: var(--red);
}

/* Quiet state - Relay handled it, owner is not interrupted. */
.notify-quiet {
  display: flex;
}
.notify-quiet-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}
.notify-quiet-mark {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  display: grid;
  place-items: center;
  font-size: 14px;
  color: var(--green);
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.3);
}
.notify-quiet-inner p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}

.notify-caption {
  margin: 12px 2px 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: rgba(240, 237, 232, 0.62);
}

.footnote {
  display: flex;
  gap: 8px;
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.6;
}

.footnote-mark {
  flex-shrink: 0;
  font-size: 11px;
  line-height: 1.7;
  opacity: 0.8;
}
