:root {
  color-scheme: dark;
  --bg: #020302;
  --panel: rgba(2, 10, 6, 0.88);
  --panel-border: rgba(34, 197, 94, 0.38);
  --text: #31df7c;
  --muted: rgba(49, 223, 124, 0.42);
  --accent: #31df7c;
  --accent-soft: rgba(49, 223, 124, 0.1);
  --accent-text: #041108;
  --shadow: rgba(9, 77, 37, 0.28);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 "SFMono-Regular", "IBM Plex Mono", "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: 0;
}

.page,
.stage,
.portrait-frame {
  min-height: 100vh;
}

.stage {
  position: relative;
  overflow: hidden;
  background: #000;
}

.portrait-frame {
  position: relative;
  z-index: 0;
}

.portrait-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.28) 24%, rgba(0, 0, 0, 0.08) 48%, rgba(0, 0, 0, 0.24) 100%);
  pointer-events: none;
}

.portrait-image {
  display: block;
  width: 100%;
  height: 100vh;
  object-fit: cover;
  object-position: center center;
}

.portrait-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100vh;
  object-fit: cover;
  object-position: center center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 700ms ease;
}

body[data-speaking="true"] .portrait-video {
  opacity: 1;
}

.inactive-mask {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(0, 0, 0, 0.6);
  pointer-events: none;
  opacity: 1;
  transition: opacity 220ms ease;
}

body[data-call-active="true"] .inactive-mask {
  opacity: 0;
}

.call-ui {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: clamp(20px, 4vw, 44px);
  transform: translateX(-50%);
  width: min(740px, calc(100vw - 32px));
  display: grid;
  gap: 8px;
}

.call-timer {
  justify-self: end;
  min-width: 72px;
  padding: 4px 0;
  color: rgba(49, 223, 124, 0.82);
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0;
  opacity: 0;
  transition: opacity 140ms ease;
}

body[data-access-state="verified"] .call-timer,
body[data-call-active="true"] .call-timer {
  opacity: 1;
}

.call-form {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--panel-border);
  border-radius: 0;
  background: var(--panel);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 0 0 1px rgba(49, 223, 124, 0.06), 0 22px 70px rgba(0, 0, 0, 0.42);
}

.consent-note {
  width: 100%;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
  text-wrap: balance;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
}

input,
button {
  font: inherit;
}

input {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(49, 223, 124, 0.3);
  border-radius: 0;
  background: rgba(2, 10, 6, 0.82);
  color: var(--text);
  padding: 14px 16px;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(49, 223, 124, 0.02);
}

input::placeholder {
  color: var(--muted);
  text-transform: lowercase;
}

input:focus {
  border-color: var(--accent);
  background: rgba(5, 16, 10, 0.95);
  box-shadow: 0 0 0 3px rgba(49, 223, 124, 0.08);
}

button {
  border: 1px solid rgba(49, 223, 124, 0.45);
  border-radius: 0;
  background: rgba(2, 10, 6, 0.92);
  color: var(--accent);
  padding: 14px 22px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 120ms ease, color 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
  text-transform: lowercase;
}

button::before {
  content: "› ";
  color: var(--accent);
}

button:disabled {
  opacity: 0.56;
  cursor: wait;
}

button:hover:not(:disabled),
button:focus-visible:not(:disabled) {
  background: var(--accent-soft);
  border-color: rgba(49, 223, 124, 0.72);
  box-shadow: 0 0 0 3px rgba(49, 223, 124, 0.08);
}

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

@media (max-width: 760px) {
  .call-ui {
    width: min(460px, calc(100vw - 24px));
    bottom: 12px;
    gap: 8px;
  }

  .call-form {
    grid-template-columns: 1fr;
    width: 100%;
    padding: 10px;
  }

  .portrait-image {
    object-position: center top;
  }

  .portrait-video {
    object-position: center top;
  }

  .consent-note {
    font-size: 10px;
  }

  .call-timer {
    justify-self: start;
    font-size: 11px;
  }
}
