:root {
  --bg: #FAFAF7;
  --ink: #111111;
  --muted: #6B6560;
  --line: #E8E4DA;
  --yellow: #F3D15E;
  --yellow-soft: #F8E7A0;
  --red: #E23B3B;
  --white: #FFFFFF;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: "DM Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
button, input { font-family: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

#app {
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
}
.screen {
  width: 100%;
  max-width: 430px;
  min-height: 100%;
  min-height: 100dvh;
  padding: calc(28px + var(--safe-top)) 28px calc(28px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  position: relative;
}

.screen-start { justify-content: center; }
.brand-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
}
.chevron {
  width: 16px;
  height: 16px;
  background: var(--yellow);
  clip-path: polygon(15% 0, 100% 50%, 15% 100%, 0 82%, 60% 50%, 0 18%);
  flex: 0 0 auto;
}
.brand-dot { opacity: 0.5; }
.brand-client { color: var(--ink); }

h1 {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 600;
  font-size: clamp(40px, 11vw, 56px);
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin: 0 0 18px;
}
.lead {
  font-size: 17px;
  line-height: 1.45;
  color: var(--muted);
  margin: 0 0 32px;
  max-width: 22em;
}
.fine {
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  margin: 16px 0 0;
}

.btn-primary, .btn-secondary {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 16px 28px;
  font-size: 16px;
  font-weight: 600;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn-primary { background: var(--ink); color: var(--white); }
.btn-secondary { background: var(--yellow); color: var(--ink); }
.btn-primary:active, .btn-secondary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.4; }
.btn-text {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 14px;
  padding: 8px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.screen-talk { align-items: center; text-align: center; padding-bottom: calc(150px + var(--safe-bottom)); }
.talk-kicker {
  margin: 8px 0 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.btn-end {
  position: absolute;
  top: calc(16px + var(--safe-top));
  right: 18px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 20px rgba(226, 59, 59, 0.28);
}

.orb {
  width: 196px;
  height: 196px;
  margin: 36px 0 18px;
  position: relative;
}
.orb-halo, .orb-ring, .orb-core {
  position: absolute;
  border-radius: 50%;
  inset: 0;
}
.orb-halo {
  background: radial-gradient(circle, rgba(243, 209, 94, 0.35), transparent 70%);
  transform: scale(0.85);
}
.orb-ring {
  inset: 28px;
  border: 2px solid transparent;
}
.orb-core {
  inset: 52px;
  background: radial-gradient(circle at 38% 32%, #fff 0%, var(--yellow-soft) 38%, var(--yellow) 100%);
  box-shadow: 0 12px 36px rgba(243, 209, 94, 0.4);
}
.orb.idle .orb-core { animation: breathe 3.2s ease-in-out infinite; }
.orb.speaking .orb-halo { animation: glow 1.1s ease-in-out infinite; }
.orb.speaking .orb-core { animation: pulse 1.1s ease-in-out infinite; }
.orb.listening .orb-ring {
  border-color: var(--ink);
  box-shadow: 0 0 0 6px rgba(17, 17, 17, 0.06);
  animation: listen 1.3s ease-in-out infinite;
}
.orb.listening .orb-core {
  background: radial-gradient(circle at 38% 32%, #fff 0%, #111 140%);
}
.orb.thinking .orb-core { animation: pulse 0.7s ease-in-out infinite; }

@keyframes breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes glow { 0%,100% { transform: scale(0.9); opacity: 0.7; } 50% { transform: scale(1.12); opacity: 1; } }
@keyframes listen { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }

.status {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 10px;
}
.caption {
  font-size: 16px;
  line-height: 1.45;
  color: var(--muted);
  margin: 0;
  max-width: 22em;
  min-height: 3em;
}

.panel { width: 100%; margin-top: 18px; }
.panel .btn-primary { width: 100%; }
#clip {
  width: 100%;
  max-height: 42vh;
  border-radius: 18px;
  background: #111;
  margin-bottom: 14px;
}
.row-actions { display: flex; gap: 10px; }
.row-actions .btn-primary, .row-actions .btn-secondary { flex: 1; padding: 14px 12px; }

.dock {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(22px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.btn-mic {
  width: 76px;
  height: 76px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 12px 28px rgba(17, 17, 17, 0.22);
  transition: background 0.15s ease, transform 0.15s ease;
}
.btn-mic:disabled { opacity: 0.35; }
.btn-mic.hot {
  background: var(--yellow);
  color: var(--ink);
  transform: scale(1.04);
}
.type-form {
  position: absolute;
  left: 20px; right: 20px;
  bottom: calc(118px + var(--safe-bottom));
  display: flex;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 8px;
}
.type-form input {
  flex: 1;
  border: 0;
  outline: none;
  font-size: 16px;
  padding: 8px 10px;
  background: transparent;
}
.type-form .btn-secondary { padding: 10px 16px; }

@media (min-width: 860px) {
  #app { background: #F1EEE6; }
  .screen {
    margin: 24px 0;
    min-height: calc(100dvh - 48px);
    background: var(--bg);
    border-radius: 28px;
    box-shadow: 0 20px 60px rgba(17, 17, 17, 0.08);
  }
}
