:root {
  color-scheme: light;
  --paper: #f6f1e8;
  --paper-deep: #e9dfcf;
  --ink: #182016;
  --ink-soft: #3f493b;
  --muted: #6f7569;
  --line: rgba(42, 54, 36, 0.16);
  --line-strong: rgba(42, 54, 36, 0.28);
  --panel: rgba(255, 252, 245, 0.78);
  --panel-solid: #fffaf0;
  --mosaic-green: #153f31;
  --mosaic-green-2: #2e6b57;
  --brass: #b2843a;
  --brass-soft: #e7c684;
  --clay: #8a5138;
  --danger: #9f352d;
  --shadow: 0 28px 80px rgba(37, 42, 28, 0.14);
  --shadow-tight: 0 14px 32px rgba(37, 42, 28, 0.12);
  --radius-xl: 34px;
  --radius-lg: 24px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Avenir Next, Avenir, Optima, Candara, Trebuchet MS, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 8%, rgba(231, 198, 132, 0.34), transparent 24rem),
    radial-gradient(circle at 86% 12%, rgba(46, 107, 87, 0.18), transparent 28rem),
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(246, 241, 232, 0.42)),
    var(--paper);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: 0.42;
  background-image:
    linear-gradient(rgba(24, 32, 22, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 32, 22, 0.055) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.16;
  background-image: radial-gradient(rgba(24, 32, 22, 0.42) 0.7px, transparent 0.7px);
  background-size: 5px 5px;
  mix-blend-mode: multiply;
}

button,
input,
textarea,
select { font: inherit; }

.page-shell {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(28px, 5vw, 70px) 0;
  display: grid;
  gap: clamp(18px, 3vw, 28px);
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.82fr);
  gap: clamp(22px, 5vw, 58px);
  align-items: stretch;
  min-height: 620px;
  padding: clamp(24px, 5vw, 58px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: clamp(28px, 4vw, 48px);
  background:
    linear-gradient(120deg, rgba(255, 252, 245, 0.94), rgba(255, 252, 245, 0.62)),
    linear-gradient(145deg, rgba(21, 63, 49, 0.08), transparent 46%);
  box-shadow: var(--shadow);
}

.hero::before {
  content: "";
  position: absolute;
  width: 460px;
  height: 460px;
  right: 34%;
  bottom: -260px;
  border: 1px solid rgba(178, 132, 58, 0.22);
  border-radius: 50%;
}


.hero__copy {
  position: relative;
  z-index: 1;
  align-self: center;
  display: grid;
  align-content: center;
  gap: 24px;
  padding-block: clamp(12px, 4vw, 42px);
}

.eyebrow,
.kicker {
  margin: 0;
  color: var(--mosaic-green-2);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1.35;
  text-transform: uppercase;
}

h1,
h2,
p { margin-top: 0; }

h1 {
  max-width: 11ch;
  margin-bottom: 0;
  font-family: Georgia, Cambria, Times New Roman, serif;
  font-size: clamp(3.3rem, 8.2vw, 7.85rem);
  font-weight: 500;
  letter-spacing: -0.075em;
  line-height: 0.86;
}

.lede {
  max-width: 64ch;
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 1.7vw, 1.28rem);
  line-height: 1.7;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 700px;
}

.hero__meta span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 252, 245, 0.58);
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 700;
}

.call-card,
.conversation-panel,
.insight-strip article {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow-tight);
  backdrop-filter: blur(18px);
}

.call-card {
  position: relative;
  z-index: 1;
  align-self: stretch;
  display: grid;
  min-height: 520px;
  padding: clamp(22px, 3vw, 32px);
  overflow: hidden;
  border-radius: var(--radius-xl);
}

.call-card::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(178, 132, 58, 0.18);
  border-radius: 26px;
  pointer-events: none;
}

.call-card__header {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.call-card h2,
.conversation-panel h2,
.insight-strip h2 {
  margin: 7px 0 0;
  font-family: Georgia, Cambria, Times New Roman, serif;
  font-weight: 500;
  letter-spacing: -0.035em;
}

.call-card h2 { font-size: clamp(2rem, 4vw, 3.1rem); line-height: 0.98; }
.conversation-panel h2 { font-size: clamp(2rem, 4vw, 3.6rem); }
.insight-strip h2 { font-size: 1.45rem; }

.market-mark {
  display: grid;
  grid-template-columns: repeat(2, 16px);
  gap: 5px;
  padding-top: 4px;
}

.market-mark span {
  width: 16px;
  height: 16px;
  border: 1px solid rgba(21, 63, 49, 0.18);
  background: var(--paper-deep);
}

.market-mark span:nth-child(1) { background: var(--mosaic-green); }
.market-mark span:nth-child(2) { background: var(--brass-soft); }
.market-mark span:nth-child(3) { background: var(--clay); }
.market-mark span:nth-child(4) { background: transparent; }

.status {
  position: relative;
  z-index: 1;
  align-self: start;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 22px 0 0;
  padding: 10px 14px 10px 12px;
  border: 1px solid rgba(21, 63, 49, 0.16);
  border-radius: 999px;
  background: rgba(21, 63, 49, 0.06);
  color: var(--mosaic-green);
  font-size: 0.88rem;
  font-weight: 800;
}

.status::before {
  content: "";
  width: 9px;
  height: 9px;
  margin-right: 9px;
  border-radius: 50%;
  background: var(--brass);
  box-shadow: 0 0 0 5px rgba(178, 132, 58, 0.14);
}

.status[data-state="live"]::before,
.status[data-state="connecting"]::before { background: #2e8062; box-shadow: 0 0 0 5px rgba(46, 128, 98, 0.16); }
.status[data-state="speaking"]::before { background: var(--brass); }
.status[data-state="ended"]::before { background: var(--muted); box-shadow: 0 0 0 5px rgba(111, 117, 105, 0.12); }
.status[data-state="error"]::before { background: var(--danger); box-shadow: 0 0 0 5px rgba(159, 53, 45, 0.13); }

.signal {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: 220px;
  width: 100%;
  margin-block: 10px 4px;
}

.signal::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(74%, 286px);
  aspect-ratio: 1;
  border: 1px solid rgba(21, 63, 49, 0.1);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(21, 63, 49, 0.05) 0 1px, transparent 1.5px);
  background-size: 18px 18px;
  transform: translate(-50%, -50%);
}

.signal__disc {
  position: relative;
  z-index: 2;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--mosaic-green);
  box-shadow: 0 0 0 7px rgba(21, 63, 49, 0.08), 0 10px 22px rgba(21, 63, 49, 0.18);
}

.signal__rings {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.signal__rings span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 120px;
  height: 120px;
  border: 1px solid rgba(21, 63, 49, 0.24);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: pulse-centered 3.8s ease-out infinite;
}

.signal__rings span:nth-child(2) { animation-delay: 1.2s; }
.signal__rings span:nth-child(3) { animation-delay: 2.4s; }

.controls {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-self: end;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 14px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 850;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, border-color 180ms ease, opacity 180ms ease;
}

.button--primary {
  color: #fffaf0;
  background: linear-gradient(135deg, var(--mosaic-green), var(--mosaic-green-2));
  box-shadow: 0 16px 30px rgba(21, 63, 49, 0.18);
}

.button--danger {
  color: #fffaf0;
  background: linear-gradient(135deg, var(--danger), #ba6049);
  box-shadow: 0 16px 30px rgba(159, 53, 45, 0.14);
}

.button--secondary {
  grid-column: 1 / -1;
  color: var(--mosaic-green);
  background: rgba(255, 252, 245, 0.62);
  border-color: var(--line-strong);
}

.button:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 20px 38px rgba(37, 42, 28, 0.16); }
.button:active:not(:disabled) { transform: translateY(0); }
.button:focus-visible { outline: 3px solid rgba(178, 132, 58, 0.42); outline-offset: 3px; }
.button:disabled { cursor: not-allowed; opacity: 0.48; box-shadow: none; }

.insight-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.insight-strip article {
  min-height: 190px;
  padding: 24px;
  border-radius: var(--radius-lg);
}

.insight-strip span {
  display: inline-flex;
  margin-bottom: 24px;
  color: var(--brass);
  font-family: Georgia, Cambria, Times New Roman, serif;
  font-size: 1.1rem;
  font-style: italic;
}

.insight-strip p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.62;
}

.conversation-panel {
  display: grid;
  grid-template-columns: 0.34fr 0.66fr;
  gap: clamp(20px, 4vw, 46px);
  min-height: 360px;
  padding: clamp(24px, 4vw, 44px);
  border-radius: var(--radius-xl);
}

.panel-heading {
  padding-right: 20px;
  border-right: 1px solid var(--line);
}

.messages {
  display: grid;
  align-content: start;
  gap: 12px;
  max-height: 480px;
  overflow: auto;
  padding-right: 8px;
  color: var(--ink);
  scrollbar-color: rgba(21, 63, 49, 0.35) transparent;
}

.message,
.muted {
  margin: 0;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 252, 245, 0.62);
  line-height: 1.55;
}

.message.USER,
.message.user {
  justify-self: end;
  max-width: min(82%, 620px);
  background: #fff7df;
  border-color: rgba(178, 132, 58, 0.28);
}

.message.AGENT,
.message.agent,
.message.assistant {
  justify-self: start;
  max-width: min(82%, 620px);
  background: rgba(21, 63, 49, 0.07);
  border-color: rgba(21, 63, 49, 0.18);
}

.message.system {
  border-style: dashed;
  color: var(--mosaic-green);
  background: rgba(46, 107, 87, 0.08);
}

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

@keyframes pulse-centered {
  from { transform: translate(-50%, -50%) scale(0.72); opacity: 0.62; }
  to { transform: translate(-50%, -50%) scale(2.35); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

@media (max-width: 940px) {
  .hero,
  .conversation-panel { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
  h1 { max-width: 12ch; }
  .panel-heading { padding-right: 0; border-right: 0; border-bottom: 1px solid var(--line); padding-bottom: 18px; }
}

@media (max-width: 760px) {
  .page-shell { width: min(100% - 24px, 1180px); padding-block: 14px 28px; }
  .hero, .conversation-panel { border-radius: 26px; }
  .call-card { min-height: 500px; border-radius: 24px; }
  .insight-strip { grid-template-columns: 1fr; }
  .insight-strip article { min-height: auto; }
  .controls { grid-template-columns: 1fr; }
  .button--secondary { grid-column: auto; }
  h1 { font-size: clamp(3.05rem, 16vw, 4.8rem); }
  .hero__meta span { width: 100%; justify-content: center; }
}

.admin-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(21, 63, 49, 0.08);
  color: var(--mosaic-green);
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
}
.admin-link:hover { border-color: var(--brass); color: var(--clay); }


.install-card {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid rgba(21, 63, 49, 0.18);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(255, 250, 240, .96), rgba(233, 223, 207, .72));
  box-shadow: var(--shadow-tight);
}
.install-card.hidden { display: none; }
.install-card h2 {
  margin: 2px 0 6px;
  font-size: clamp(1.1rem, 2vw, 1.45rem);
}
.install-card p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.45;
}
.install-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}
@media (max-width: 760px) {
  .install-card { align-items: stretch; flex-direction: column; }
  .install-actions { justify-content: stretch; }
  .install-actions .button { flex: 1; }
}
