:root {
  --bg: #000;
  --text: #fff;
  --muted: rgba(255, 255, 255, 0.72);
  --glass: rgba(30, 30, 32, 0.72);
  --button: rgba(255, 255, 255, 0.18);
  --accept: #34c759;
  --end: #ff3b30;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

[hidden] { display: none !important; }

.screen {
  position: fixed;
  inset: 0;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

/* Lobby */

#preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);  /* like a mirror, as you're used to seeing yourself */
  filter: blur(2px) brightness(0.6);
}

.card {
  position: relative;
  width: min(420px, 100%);
  padding: 32px 28px 26px;
  border-radius: 24px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  text-align: center;
}

.brand {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accept);
}

h1 {
  margin: 10px 0 6px;
  font-size: 28px;
  line-height: 1.2;
}

.sub { margin: 0; color: var(--muted); }

.note { margin: 16px 0 0; min-height: 1.4em; font-size: 14px; color: var(--muted); }

.buttons {
  display: flex;
  justify-content: center;
  gap: 64px;
  margin-top: 28px;
}

.labels {
  display: flex;
  justify-content: center;
  gap: 64px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

.labels span { width: 64px; }

/* Round buttons, FaceTime-style */

.round {
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 50%;
  background: var(--button);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.1s, background 0.15s;
}

.round:active { transform: scale(0.94); }
.round svg { width: 28px; height: 28px; fill: #fff; }
.round.accept { background: var(--accept); }
.round.end { background: var(--end); }
.round.end svg { transform: rotate(135deg); }
.round.off { background: #fff; }
.round.off svg { fill: #000; }
.round:disabled { opacity: 0.5; cursor: default; }

.pill {
  margin-top: 24px;
  padding: 12px 28px;
  border: 0;
  border-radius: 999px;
  background: var(--accept);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* Call */

#call { padding: 0; }

#remote {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;  /* never crop: their captions are drawn on their video */
  background: #000;
}

.waiting {
  position: absolute;
  top: 40%;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 22px;
  color: var(--muted);
}

#self {
  position: absolute;
  right: 16px;
  top: calc(16px + env(safe-area-inset-top));  /* top corner: the bottom is for captions and controls */
  width: clamp(110px, 22vw, 240px);
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  transform: scaleX(-1);
  background: #222;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}

@media (orientation: portrait) {
  #self { aspect-ratio: 3 / 4; width: clamp(90px, 28vw, 180px); }
}

.controls {
  position: absolute;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
}

.controls .round { width: 56px; height: 56px; }
.controls .round svg { width: 24px; height: 24px; }

.captions {
  position: absolute;
  left: 50%;
  bottom: calc(112px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: max-content;
  max-width: min(760px, calc(100% - 32px));
  padding: 10px 18px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.72);
  font-size: clamp(18px, 3.2vw, 28px);
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  white-space: pre-line;  /* their last sentence, then what they're signing now */
}

/* White with a crossed-out icon = you turned it off (mic, camera, sound). Green = captions on. */
.round.on { background: var(--accept); }

.toast {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--glass);
  font-size: 14px;
  white-space: nowrap;
}


/* ===== Homepage (index.html) — minimal, dark, Poppins, orange title ===== */
:root { --brand-green: #22C55E; --brand-orange: #F5922F; }

body.home {
  overflow: auto;
  background: #121212;
  color: #e4e4e7;
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-head: "Bitter", Georgia, serif;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #e4e4e7;
  text-decoration: none;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.brand-logo { height: 26px; width: auto; }
.topnav { display: flex; gap: 20px; }
.navlink {
  color: #a1a1aa;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.navlink:hover { color: #fff; }

.page {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 28px 40px;
}

.panel { max-width: 560px; }
.hero-logo { height: 72px; width: auto; margin-bottom: 28px; display: block; }

.title {
  font-family: var(--font-head);
  font-size: 46px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
  color: #fafafa;
}
.lede { font-size: 19px; color: #a1a1aa; margin: 0 0 36px; }

.panel h2 { font-family: var(--font-head); font-size: 18px; font-weight: 600; color: #fafafa; margin: 26px 0 8px; }
.panel p { font-size: 16px; line-height: 1.6; color: #d4d4d8; margin: 0 0 12px; }
.panel ul { margin: 0 0 12px; padding-left: 20px; }
.panel li { font-size: 16px; line-height: 1.6; color: #d4d4d8; margin-bottom: 8px; }
.panel a { color: var(--brand-orange); }
.updated { font-size: 13px; color: #71717a; margin-top: -4px !important; }

.join label {
  display: block;
  font-size: 14px;
  color: #a1a1aa;
  margin-bottom: 10px;
}
.join-row { display: flex; gap: 12px; align-items: stretch; }
#join-input {
  flex: 1;
  padding: 14px 16px;
  font-size: 16px;
  font-family: inherit;
  color: #fff;
  background: #1e1e1e;
  border: 1px solid #3f3f46;
  border-radius: 10px;
  outline: none;
}
#join-input::placeholder { color: #71717a; }
#join-input:focus { border-color: var(--brand-orange); }
.join button {
  padding: 0 26px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: var(--brand-orange);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
}
.join button:active { transform: scale(0.98); }
.error { color: #f87171; font-size: 14px; margin: 14px 0 0; }

.fineprint { font-size: 14px; line-height: 1.6; color: #71717a; margin-top: 36px; }

.foot {
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 28px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #71717a;
}
.foot nav { display: flex; gap: 18px; }
.foot a { color: var(--brand-orange); text-decoration: none; }
.foot a:hover { text-decoration: underline; }

@media (max-width: 560px) {
  .title { font-size: 36px; }
  .join-row { flex-direction: column; }
  .join button { padding: 14px; }
  .topnav { gap: 14px; }
  .foot { flex-direction: column; gap: 12px; align-items: flex-start; }
}
