:root {
  color-scheme: dark;
  --ink: #f3fbf8;
  --muted: #93aaa4;
  --line: rgba(170, 223, 210, 0.13);
  --accent: #5ef0be;
  --accent-bright: #baffea;
  --danger: #ff806f;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 12%, rgba(45, 138, 113, 0.22), transparent 34rem),
    radial-gradient(circle at 88% 88%, rgba(30, 112, 103, 0.18), transparent 32rem),
    #071011;
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.18;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, black, transparent 80%);
}

button { font: inherit; }

.shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
  width: min(1180px, calc(100% - 40px));
  min-height: calc(100vh - 64px);
  margin: 32px auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(5, 14, 15, 0.7);
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(22px);
}

.hero, .activity { padding: clamp(28px, 5vw, 64px); }
.hero { position: relative; display: flex; flex-direction: column; align-items: flex-start; }
.activity { display: flex; flex-direction: column; border-left: 1px solid var(--line); background: rgba(9, 22, 22, .62); }

.brand { display: flex; align-items: center; gap: 11px; font-size: 12px; font-weight: 800; letter-spacing: .24em; }
.brand-mark { display: inline-flex; align-items: flex-end; gap: 3px; width: 23px; height: 22px; }
.brand-mark i { width: 5px; border-radius: 5px; background: var(--accent); transform: skew(-18deg); }
.brand-mark i:nth-child(1) { height: 12px; }
.brand-mark i:nth-child(2) { height: 21px; }
.brand-mark i:nth-child(3) { height: 16px; }

.eyebrow, .label { color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.eyebrow-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: clamp(54px, 9vh, 92px); }
.config-badge, .demo-badge { padding: 5px 8px; border: 1px solid rgba(94,240,190,.18); border-radius: 999px; color: #a9c7bf; background: rgba(94,240,190,.06); font-size: 9px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
h1 { max-width: 560px; margin: 12px 0 14px; font-size: clamp(48px, 7vw, 88px); font-weight: 550; line-height: .95; letter-spacing: -.055em; }
.lede { max-width: 580px; margin: 0; color: var(--muted); font-size: clamp(16px, 2vw, 19px); line-height: 1.6; }

.voice-orb { position: relative; display: grid; place-items: center; width: 178px; height: 178px; margin: clamp(44px, 7vh, 72px) auto; align-self: center; }
.ring { position: absolute; border: 1px solid rgba(94, 240, 190, .2); border-radius: 50%; }
.ring-one { inset: 12px; }
.ring-two { inset: 0; opacity: .45; }
.orb-core { display: grid; place-items: center; width: 116px; height: 116px; border: 1px solid rgba(186, 255, 234, .32); border-radius: 50%; background: radial-gradient(circle at 38% 30%, rgba(186,255,234,.35), rgba(32,119,96,.25) 40%, rgba(9,31,28,.9) 76%); box-shadow: 0 0 52px rgba(94,240,190,.15), inset 0 0 28px rgba(94,240,190,.12); }
.wave { display: flex; align-items: center; gap: 5px; height: 34px; }
.wave i { display: block; width: 3px; height: 9px; border-radius: 4px; background: var(--accent-bright); box-shadow: 0 0 8px rgba(186,255,234,.55); }
.wave i:nth-child(2), .wave i:nth-child(4) { height: 19px; }
.wave i:nth-child(3) { height: 31px; }
.is-connected .ring-one { animation: pulse 2.2s ease-out infinite; }
.is-connected .ring-two { animation: pulse 2.2s .7s ease-out infinite; }
.is-connected .wave i { animation: speak .8s ease-in-out infinite alternate; }
.is-connected .wave i:nth-child(2) { animation-delay: -.3s; }
.is-connected .wave i:nth-child(3) { animation-delay: -.55s; }
.is-connected .wave i:nth-child(4) { animation-delay: -.15s; }

.state-card { display: grid; grid-template-columns: 1fr 1fr 1fr; width: 100%; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.state-card > div { display: flex; flex-direction: column; gap: 8px; padding: 18px 16px; }
.state-card > div:first-child { padding-left: 0; }
.state-card > div + div { border-left: 1px solid var(--line); }
.status { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.status i { width: 8px; height: 8px; border-radius: 50%; background: #64736f; box-shadow: 0 0 0 4px rgba(100,115,111,.1); }
.status i.connecting { background: #ffd075; animation: blink 1s infinite; }
.status i.connected { background: var(--accent); box-shadow: 0 0 0 4px rgba(94,240,190,.12), 0 0 12px rgba(94,240,190,.4); }
.status i.error { background: var(--danger); }
.value { color: #d8e8e4; font-size: 14px; }

.controls { display: flex; gap: 12px; width: 100%; margin-top: 24px; }
.button { min-height: 52px; padding: 0 22px; border-radius: 14px; border: 1px solid transparent; cursor: pointer; font-weight: 750; transition: transform .18s ease, opacity .18s ease, background .18s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:focus-visible { outline: 3px solid rgba(94,240,190,.28); outline-offset: 3px; }
.button:disabled { cursor: not-allowed; opacity: .42; }
.button-primary { flex: 1; color: #06120f; background: var(--accent); box-shadow: 0 10px 28px rgba(94,240,190,.14); }
.button-secondary { color: var(--ink); border-color: var(--line); background: rgba(255,255,255,.035); }
.button-icon { margin-right: 8px; font-size: 9px; }
.privacy-note { align-self: center; margin: 14px 0 0; color: #667b76; font-size: 11px; text-align: center; }

.activity-heading { display: flex; align-items: flex-end; justify-content: space-between; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.activity h2 { margin: 7px 0 0; font-size: 25px; font-weight: 600; letter-spacing: -.03em; }
.duration { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.transcript { flex: 1; min-height: 360px; max-height: 62vh; overflow: auto; padding: 28px 3px 28px 0; scrollbar-color: rgba(94,240,190,.25) transparent; }
.empty-state { display: grid; place-items: center; align-content: center; height: 100%; min-height: 310px; color: #60736e; text-align: center; }
.empty-state p { max-width: 250px; margin: 16px 0; font-size: 13px; line-height: 1.6; }
.empty-icon { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; color: var(--accent); }
.utterance { margin-bottom: 24px; }
.utterance .speaker { display: block; margin-bottom: 7px; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.utterance.assistant .speaker { color: #a5b8b3; }
.utterance p { margin: 0; color: #dceae6; line-height: 1.62; }
.utterance.assistant p { color: #b8cbc6; }
.tool-activity { padding: 16px 0; border-top: 1px solid var(--line); }
.tool-heading { display: flex; align-items: center; justify-content: space-between; color: #8fa49f; font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.demo-badge { color: #ffd997; border-color: rgba(255,217,151,.18); background: rgba(255,217,151,.06); }
.tool-actions { margin-top: 10px; }
.tool-actions > p { margin: 0; color: #61736f; font-size: 11px; line-height: 1.5; }
.tool-action { display: flex; align-items: flex-start; gap: 10px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.025); }
.tool-action + .tool-action { margin-top: 8px; }
.tool-action i { flex: 0 0 auto; width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: #ffd075; }
.tool-action.success i { background: var(--accent); }
.tool-action.failed i { background: var(--danger); }
.tool-action strong { display: block; color: #d8e8e4; font-size: 11px; }
.tool-action span { display: block; margin-top: 2px; color: #738782; font-size: 10px; line-height: 1.45; }
.debug-panel { border-top: 1px solid var(--line); color: #6f8580; font-size: 11px; }
.debug-panel summary { padding: 15px 0 0; cursor: pointer; letter-spacing: .08em; text-transform: uppercase; }
.debug-panel ol { max-height: 110px; margin: 12px 0 0; padding: 0 0 0 22px; overflow: auto; line-height: 1.7; }

@keyframes pulse { 0% { transform: scale(.84); opacity: .65; } 100% { transform: scale(1.2); opacity: 0; } }
@keyframes speak { from { transform: scaleY(.55); } to { transform: scaleY(1.25); } }
@keyframes blink { 50% { opacity: .4; } }

@media (max-width: 850px) {
  .shell { grid-template-columns: 1fr; width: min(680px, calc(100% - 24px)); margin: 12px auto; }
  .activity { border-top: 1px solid var(--line); border-left: 0; }
  .transcript { min-height: 260px; max-height: 48vh; }
}

@media (max-width: 520px) {
  .hero, .activity { padding: 26px 20px; }
  .eyebrow { margin-top: 48px; }
  h1 { font-size: 50px; }
  .state-card { grid-template-columns: 1fr; }
  .state-card > div, .state-card > div:first-child { padding: 13px 0; }
  .state-card > div + div { border-top: 1px solid var(--line); border-left: 0; }
  .controls { flex-direction: column; }
  .button { width: 100%; }
}

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