:root {
  color-scheme: dark;
  --ink: #171713;
  --paper: #f1efe8;
  --acid: #d7ff43;
  --coral: #ff6b4a;
  --muted: #99998f;
  --line: rgba(241, 239, 232, 0.13);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 50% 35%, rgba(215, 255, 67, 0.065), transparent 28rem),
    linear-gradient(115deg, #11110e, var(--ink) 45%, #1d1c17);
  color: var(--paper);
  font-family: "Manrope", system-ui, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
}

.call-shell {
  width: min(100%, 38rem);
  min-height: 100dvh;
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  display: grid;
  grid-template-rows: auto 1fr auto;
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  font: 500 .68rem/1 "DM Mono", monospace;
  letter-spacing: .18em;
}

.brand-mark {
  width: .72rem;
  height: .72rem;
  background: var(--acid);
  border-radius: 50% 50% 2px 50%;
  transform: rotate(45deg);
}

.call-card {
  align-self: center;
  padding: 2rem 0;
}

.status-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .65rem;
  font: 400 .68rem/1 "DM Mono", monospace;
  letter-spacing: .08em;
  color: var(--muted);
}

.status-dot {
  width: .46rem;
  height: .46rem;
  border-radius: 50%;
  background: #67675f;
  transition: background .25s, box-shadow .25s;
}

body[data-state="live"] .status-dot {
  background: var(--acid);
  box-shadow: 0 0 0 .32rem rgba(215, 255, 67, .11);
}

body[data-state="error"] .status-dot { background: var(--coral); }

.timer { color: var(--paper); }

.portrait {
  height: clamp(15rem, 40vh, 22rem);
  display: grid;
  place-items: center;
}

.orb {
  width: clamp(10.5rem, 40vw, 14rem);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(.32rem, 1.4vw, .55rem);
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: inset 0 0 3.5rem rgba(215, 255, 67, .04), 0 0 0 1.2rem rgba(255,255,255,.015);
}

.orb span {
  width: .28rem;
  height: 1.35rem;
  border-radius: 2rem;
  background: var(--acid);
  transform: scaleY(.35);
  transition: background .25s;
}

body[data-state="live"] .orb span { animation: voice 1.05s ease-in-out infinite; }
body[data-state="live"] .orb span:nth-child(2) { animation-delay: -.7s; }
body[data-state="live"] .orb span:nth-child(3) { animation-delay: -.35s; }
body[data-state="live"] .orb span:nth-child(4) { animation-delay: -.85s; }
body[data-state="live"] .orb span:nth-child(5) { animation-delay: -.2s; }
body[data-state="error"] .orb span { background: var(--coral); }

@keyframes voice { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(2.7); } }

.identity { text-align: center; }
.identity > p:first-child {
  color: var(--acid);
  font: 500 .65rem/1 "DM Mono", monospace;
  letter-spacing: .18em;
  margin: 0 0 .8rem;
}

h1 {
  margin: 0;
  font-size: clamp(1.85rem, 7vw, 3rem);
  line-height: 1.08;
  letter-spacing: -.05em;
}

.hint { margin: .75rem 0 0; color: var(--muted); font-size: .85rem; }

.captions {
  min-height: 3rem;
  max-height: 14rem;
  overflow-y: auto;
  margin: 1.5rem auto .5rem;
  max-width: 27rem;
  text-align: left;
  color: #c4c2b8;
  font-size: .8rem;
  line-height: 1.55;
}

.controls {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5rem;
  width: min(100%, 23rem);
  margin: 1.15rem auto 0;
}

button { font: inherit; }

.round-control {
  justify-self: center;
  width: 4rem;
  border: 0;
  color: var(--muted);
  background: transparent;
  display: grid;
  justify-items: center;
  gap: .45rem;
  cursor: pointer;
  font: 500 .63rem/1 "DM Mono", monospace;
}

.round-control svg {
  width: 2.8rem;
  height: 2.8rem;
  padding: .78rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, .06);
  fill: currentColor;
}

.round-control:disabled { opacity: .35; cursor: default; }
.mute-control[aria-pressed="true"] { color: var(--coral); }

.call-control {
  width: 4.6rem;
  height: 4.6rem;
  border: 0;
  border-radius: 50%;
  background: var(--acid);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 0 0 .55rem rgba(215, 255, 67, .08);
  transition: transform .2s, background .2s;
}

.call-control:hover { transform: scale(1.04); }
.call-control svg { width: 1.65rem; fill: currentColor; }
body[data-state="live"] .call-control { background: var(--coral); color: white; }
body[data-state="live"] .call-control svg { transform: rotate(135deg); }

.login-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  position: relative;
}

.login-card {
  width: min(100%, 27rem);
  padding: clamp(2rem, 8vw, 3.5rem);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .025);
  box-shadow: 0 2rem 8rem rgba(0, 0, 0, .28);
}

.login-kicker {
  margin: 1.5rem 0 .8rem;
  color: var(--acid);
  font: 500 .65rem/1 "DM Mono", monospace;
  letter-spacing: .18em;
}

.login-card h1 { font-size: clamp(2rem, 9vw, 3rem); }
.login-card .hint { line-height: 1.5; }
.login-card form { margin-top: 2rem; }
.login-card label { display: block; margin-bottom: .55rem; font-size: .72rem; }
.login-card input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: .25rem;
  background: rgba(255,255,255,.04);
  color: var(--paper);
  padding: .85rem;
  font: inherit;
}
.login-card input:focus { border-color: var(--acid); outline: 1px solid var(--acid); }
.login-card button {
  width: 100%;
  margin-top: .75rem;
  border: 0;
  border-radius: .25rem;
  padding: .85rem;
  background: var(--acid);
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}
.login-card button:disabled { opacity: .55; cursor: wait; }
.login-error { min-height: 1.2rem; margin: .7rem 0 0; color: var(--coral); font-size: .72rem; }

footer {
  text-align: center;
  color: #686860;
  font: 400 .58rem/1 "DM Mono", monospace;
  letter-spacing: .08em;
  padding-top: 1rem;
}

@media (max-height: 700px) {
  .portrait { height: 12rem; }
  .orb { width: 9rem; }
  .call-card { padding: 1rem 0; }
  .captions { margin-top: 1rem; min-height: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  .orb span { animation: none !important; transform: scaleY(1) !important; }
  * { scroll-behavior: auto !important; }
}
