:root {
  --bg-deep: #1a120c;
  --bg-mid: #2a1c12;
  --sand: #c4a574;
  --amber: #e0a84a;
  --gold: #f0d9a0;
  --ember: #b85c2a;
  --ink: #f7efe3;
  --muted: #a89278;
  --danger: #c45c4a;
  --radius: 18px;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-body: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg-deep);
  color: var(--ink);
  font-family: var(--font-body);
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
}

.mic-gate {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(12, 8, 5, 0.72);
  backdrop-filter: blur(10px);
}

.mic-gate[hidden] {
  display: none !important;
}

.mic-gate-card {
  max-width: 420px;
  text-align: center;
  padding: 2rem 1.5rem;
  border: 1px solid rgba(196, 165, 116, 0.28);
  border-radius: 18px;
  background: rgba(26, 18, 12, 0.92);
}

.mic-gate-card h2 {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--gold);
  margin: 0.35rem 0 0.75rem;
  font-size: clamp(1.6rem, 5vw, 2.1rem);
}

.mic-gate-card .talk {
  margin-top: 1.25rem;
  width: min(100%, 280px);
}

.mic-gate-card .mic-skip {
  margin-top: 0.65rem;
  width: min(100%, 280px);
}

.mic-gate-hint {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
  min-height: 1.2em;
}

.atmosphere {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(224, 168, 74, 0.22), transparent 55%),
    radial-gradient(ellipse 60% 40% at 80% 90%, rgba(184, 92, 42, 0.18), transparent 50%),
    linear-gradient(165deg, #120c08 0%, #2a1c12 45%, #1a120c 100%);
  pointer-events: none;
  z-index: 0;
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.07;
  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='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.stage {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  min-height: 100dvh;
}

.brand {
  text-align: center;
}

.eyebrow {
  margin: 0 0 0.4rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.7rem;
  color: var(--sand);
}

.brand h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.4rem, 8vw, 3.6rem);
  letter-spacing: 0.02em;
  color: var(--gold);
}

.tagline {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.presence {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
  align-items: center;
}

@media (max-width: 640px) {
  .presence {
    grid-template-columns: 1fr;
  }
}

.video-shell {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #0d0906;
  border: 1px solid rgba(196, 165, 116, 0.25);
}

#camera {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  opacity: 0.72;
  filter: saturate(0.75) contrast(1.05);
}

#motion {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.badge {
  position: absolute;
  left: 0.75rem;
  bottom: 0.75rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  background: rgba(26, 18, 12, 0.72);
  color: var(--sand);
  border: 1px solid rgba(196, 165, 116, 0.3);
}

.badge.active {
  color: var(--gold);
  border-color: rgba(224, 168, 74, 0.55);
}

.orb {
  justify-self: center;
  width: 140px;
  height: 140px;
  position: relative;
  display: grid;
  place-items: center;
}

.orb-ring,
.orb-core {
  position: absolute;
  border-radius: 50%;
}

.orb-ring {
  inset: 0;
  border: 1px solid rgba(224, 168, 74, 0.35);
  animation: breathe 4.5s ease-in-out infinite;
}

.orb-core {
  width: 46%;
  height: 46%;
  background: radial-gradient(circle at 35% 30%, var(--gold), var(--ember) 70%);
  box-shadow: 0 0 40px rgba(224, 168, 74, 0.35);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.orb[data-state="listening"] .orb-core {
  transform: scale(1.15);
  box-shadow: 0 0 55px rgba(224, 168, 74, 0.55);
}

.orb[data-state="thinking"] .orb-ring {
  animation-duration: 1.6s;
  border-color: rgba(240, 217, 160, 0.7);
}

.orb[data-state="speaking"] .orb-core {
  transform: scale(1.28);
  box-shadow: 0 0 70px rgba(224, 168, 74, 0.7);
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.65;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

.dialogue {
  min-height: 7rem;
  text-align: center;
}

.status {
  margin: 0 0 0.85rem;
  color: var(--sand);
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}

.line {
  margin: 0.4rem 0;
  font-family: var(--font-display);
  line-height: 1.45;
}

.line.you {
  color: var(--muted);
  font-size: 1rem;
}

.line.reply {
  color: var(--ink);
  font-size: 1.25rem;
}

.controls {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: stretch;
}

.talk {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 1.05rem 1.4rem;
  font-size: 1.05rem;
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #1a120c;
  background: linear-gradient(180deg, var(--gold), var(--amber));
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.talk:active,
.talk.recording {
  transform: scale(0.98);
  filter: brightness(1.05);
}

.talk.recording {
  background: linear-gradient(180deg, #f2c56b, var(--ember));
}

.ghost {
  appearance: none;
  border: 1px solid rgba(196, 165, 116, 0.35);
  background: transparent;
  color: var(--sand);
  border-radius: 999px;
  padding: 0.7rem 1rem;
  cursor: pointer;
}

.typed input {
  width: 100%;
  border-radius: 999px;
  border: 1px solid rgba(196, 165, 116, 0.28);
  background: rgba(26, 18, 12, 0.55);
  color: var(--ink);
  padding: 0.85rem 1.1rem;
  font-size: 1rem;
  outline: none;
}

.typed input:focus {
  border-color: rgba(224, 168, 74, 0.6);
}

.feedback {
  display: flex;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.35rem;
}

.feedback input {
  flex: 1;
  border-radius: 999px;
  border: 1px solid rgba(196, 165, 116, 0.22);
  background: rgba(26, 18, 12, 0.4);
  color: var(--muted);
  padding: 0.55rem 0.9rem;
  font-size: 0.9rem;
  outline: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
