:root {
  --bg: #070b14;
  --card: #0f172a;
  --line: rgba(148, 163, 184, 0.18);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #22d3ee;
  --accent-2: #34d399;
  --danger: #f87171;
  --radius: 22px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(34, 211, 238, 0.16), transparent 55%),
    radial-gradient(800px 480px at 90% 0%, rgba(52, 211, 153, 0.12), transparent 50%),
    var(--bg);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
}

a { color: var(--accent); }
.wrap {
  width: min(960px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  text-decoration: none;
  color: inherit;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: block;
  flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(34, 211, 238, 0.14);
}
.logo {
  font-weight: 900;
  letter-spacing: -0.04em;
  font-size: 1.15rem;
  line-height: 1;
}
.logo span { color: var(--accent); }
.tag { color: var(--muted); font-size: .85rem; }

.hero { text-align: center; padding: .35rem 0 1.25rem; }
.eyebrow {
  display: inline-flex;
  margin: 0 0 .75rem;
  padding: .3rem .7rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.22);
}
.hero h1 {
  margin: 0 0 .65rem;
  font-size: clamp(1.85rem, 4.5vw, 2.75rem);
  letter-spacing: -0.045em;
  line-height: 1.05;
}
.hero > p {
  margin: 0 auto 1.25rem;
  max-width: 34rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}
.hero-art {
  margin: 1.35rem auto 0;
  width: min(100%, 420px);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #020617;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}
.hero-art img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
}
.feature-grid {
  display: grid;
  gap: .85rem;
  margin: 1.5rem auto 0;
  max-width: 860px;
  text-align: left;
}
@media (min-width: 720px) {
  .feature-grid { grid-template-columns: repeat(3, 1fr); }
}
.feature {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem 1.05rem 1.1rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
}
.feature-icon {
  width: auto;
  min-width: 2rem;
  height: 1.6rem;
  padding: 0 .45rem;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  margin-bottom: .55rem;
  background: rgba(34, 211, 238, 0.1);
  color: var(--accent);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .06em;
}
.feature h3 {
  margin: 0 0 .35rem;
  font-size: .98rem;
  letter-spacing: -0.02em;
}
.feature p {
  margin: 0;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.45;
}
.how {
  list-style: none;
  margin: 1.5rem auto 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .55rem .85rem;
  justify-content: center;
  max-width: 40rem;
  color: var(--muted);
  font-size: .9rem;
}
.how li {
  padding: .45rem .8rem;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.65);
  border: 1px solid var(--line);
}
.how strong { color: var(--text); }

.mode-pick {
  display: grid;
  gap: .65rem;
  margin: 0 0 1rem;
}
@media (min-width: 560px) {
  .mode-pick { grid-template-columns: 1fr 1fr; }
}
.mode-card {
  appearance: none;
  text-align: left;
  cursor: pointer;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #020617;
  color: var(--text);
  padding: .9rem 1rem;
  font: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.mode-card strong {
  display: block;
  margin-bottom: .3rem;
  font-size: .98rem;
}
.mode-card span {
  display: block;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.4;
}
.mode-card.is-on {
  border-color: rgba(34, 211, 238, 0.55);
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.25), 0 12px 30px rgba(34, 211, 238, 0.08);
}
.mode-card:hover { border-color: rgba(34, 211, 238, 0.35); }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  justify-content: center;
}

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: .9rem 1.25rem;
  min-height: 44px;
  font: inherit;
  font-weight: 800;
  color: #042f2e;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 14px 40px rgba(34, 211, 238, 0.2);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-ghost {
  color: var(--text);
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--line);
  box-shadow: none;
}
.btn-danger {
  color: #fff;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  box-shadow: 0 12px 30px rgba(239, 68, 68, 0.25);
}
.btn-sm { padding: .65rem 1rem; font-size: .85rem; min-height: 40px; }

.card {
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

.panel { display: none; }
.panel.is-on { display: block; }

.label {
  display: grid;
  gap: .35rem;
  margin: 0 0 .85rem;
  font-size: .88rem;
  font-weight: 700;
  color: var(--muted);
}
.input {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #020617;
  color: var(--text);
  padding: .85rem 1rem;
  font: inherit;
  font-size: 16px; /* prevent iOS zoom on focus */
  max-width: 100%;
}
.input:focus {
  outline: 2px solid rgba(34, 211, 238, 0.45);
  border-color: transparent;
}

.code-giant {
  font-size: clamp(2.4rem, 8vw, 4rem);
  font-weight: 900;
  letter-spacing: .18em;
  text-align: center;
  margin: .5rem 0 1rem;
  color: #fff;
}

.muted { color: var(--muted); }
.err {
  display: none;
  margin: 0 0 1rem;
  padding: .75rem 1rem;
  border-radius: 14px;
  background: rgba(127, 29, 29, 0.35);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fecaca;
  font-weight: 600;
}
.err.is-on { display: block; }

.room {
  display: grid;
  gap: 1rem;
}
@media (min-width: 860px) {
  .room { grid-template-columns: minmax(0, 1fr) 240px; }
}

.stage {
  position: relative;
  min-height: 280px;
  border-radius: 20px;
  overflow: hidden;
  background: #020617;
  border: 1px solid var(--line);
}
.stage > video#ez-video {
  width: 100%;
  height: 100%;
  min-height: 280px;
  max-height: min(70vh, 560px);
  object-fit: contain;
  background: #000;
  display: block;
}
/* Size the WRAPPER - mobile browsers ignore fixed height on <video> itself */
.local-pip-wrap {
  position: absolute;
  top: .65rem;
  right: .65rem;
  width: 108px;
  height: 144px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: #000;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  z-index: 4;
  pointer-events: none;
}
.local-pip-wrap[hidden] { display: none !important; }
.local-pip-wrap > video {
  display: block;
  width: 108px !important;
  height: 144px !important;
  max-width: none !important;
  max-height: none !important;
  min-height: 0 !important;
  object-fit: cover !important;
  object-position: center;
  border: 0;
  border-radius: 0;
}
/* Must NOT use display:none - Safari/iOS blocks playback on display:none audio */
.remote-audio {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  opacity: 0.01;
  pointer-events: none;
  z-index: -1;
}
.stage-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1.5rem;
  color: var(--muted);
}
.stage-empty strong { color: var(--text); display: block; margin-bottom: .35rem; }
.stage-bar {
  position: absolute;
  right: .75rem;
  bottom: .75rem;
  display: flex;
  gap: .4rem;
  opacity: 1; /* always visible - hover-only hid controls when mobile chrome shifted */
  z-index: 6;
  pointer-events: auto;
}
.stage-btn {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(2, 6, 23, 0.88);
  color: #e2e8f0;
  font: inherit;
  font-size: .78rem;
  font-weight: 700;
  padding: .5rem .8rem;
  min-height: 36px;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-tap-highlight-color: transparent;
}
.stage-btn:hover { border-color: var(--accent); color: #fff; }
.stage-btn[hidden] { display: none !important; }
/* CSS fullscreen - no native Fullscreen API, so no "Press Esc to exit" banner */
body.ez-fs-lock {
  overflow: hidden !important;
}
.stage.is-fs {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  border-radius: 0 !important;
  border: 0 !important;
  background: #000 !important;
  z-index: 99999 !important;
}
.stage.is-fs > video#ez-video {
  min-height: 0;
  max-height: none;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
}
.stage.is-fs .stage-bar {
  position: fixed !important;
  right: max(12px, env(safe-area-inset-right, 0px)) !important;
  left: auto !important;
  /* bottom set via JS from visualViewport so URL bar can't cover it */
  bottom: max(12px, env(safe-area-inset-bottom, 0px)) !important;
  opacity: 1 !important;
  z-index: 100001 !important;
}
.stage.is-fs .stage-bar .stage-btn:not([hidden]) {
  display: inline-flex !important;
}
.stage.is-fs .local-pip-wrap {
  position: fixed !important;
  top: max(10px, env(safe-area-inset-top, 0px)) !important;
  right: max(10px, env(safe-area-inset-right, 0px)) !important;
  left: auto !important;
  bottom: auto !important;
  width: 84px !important;
  height: 112px !important;
  max-width: 84px !important;
  max-height: 112px !important;
  z-index: 100000 !important;
}
.stage.is-fs .local-pip-wrap > video {
  width: 84px !important;
  height: 112px !important;
  max-width: 84px !important;
  max-height: 112px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  object-fit: cover !important;
}

.stats {
  margin-top: 1rem;
  padding-top: .85rem;
  border-top: 1px solid var(--line);
}
.stats h3 { margin: 0 0 .55rem; font-size: .95rem; }
.stats-card {
  background: #020617;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .55rem .65rem;
  margin-bottom: .45rem;
  font-size: .78rem;
  line-height: 1.45;
}
.stats-card:last-child { margin-bottom: 0; }
.stats-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .4rem;
  margin-bottom: .35rem;
  font-weight: 700;
  color: var(--text);
}
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .2rem .55rem;
  color: var(--muted);
}
.stats-grid span { color: var(--text); font-variant-numeric: tabular-nums; }
.dot {
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  display: inline-block;
  background: #64748b;
  box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.18);
}
.dot.ok { background: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18); }
.dot.warn { background: #fbbf24; box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.18); }
.dot.bad { background: #f87171; box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.18); }

.side h3 {
  margin: 0 0 .65rem;
  font-size: .95rem;
}
.people {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .4rem;
}
.people li {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  padding: .55rem .7rem;
  border-radius: 12px;
  background: #020617;
  border: 1px solid var(--line);
  font-size: .9rem;
}
.pill {
  display: inline-flex;
  align-items: center;
  padding: .15rem .5rem;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 800;
  background: rgba(34, 211, 238, 0.12);
  color: var(--accent);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1rem;
}

.foot {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .82rem;
}
.foot-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
  justify-content: space-between;
  align-items: flex-start;
  text-align: left;
}
.foot-word {
  font-weight: 900;
  letter-spacing: -0.04em;
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: .35rem;
}
.foot-word span { color: var(--accent); }
.foot-brand p { margin: 0 0 .55rem; max-width: 28rem; line-height: 1.45; }
.foot-company { font-size: .8rem; }
.foot-company strong { color: var(--text); font-weight: 700; }
.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.1rem;
  align-items: center;
}
.foot-links a {
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}
.foot-links a:hover { color: var(--accent); }
.foot-copy {
  margin: 1.25rem 0 0;
  text-align: center;
  font-size: .78rem;
  color: #64748b;
}

.legal {
  max-width: 42rem;
  margin: 0 auto;
  line-height: 1.55;
}
.legal h1 {
  margin: .35rem 0 .5rem;
  letter-spacing: -0.03em;
  font-size: clamp(1.6rem, 4vw, 2.1rem);
}
.legal h2 {
  margin: 1.4rem 0 .45rem;
  font-size: 1.05rem;
  color: var(--text);
}
.legal p, .legal li { color: var(--muted); }
.legal ul { padding-left: 1.2rem; }
.legal a { font-weight: 600; }
.legal-meta { margin: 0 0 1.25rem; font-size: .88rem; }
.pill-legal {
  display: inline-flex;
  margin: 0;
  padding: .2rem .55rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: rgba(34, 211, 238, 0.12);
  color: var(--accent);
}
.table-wrap { overflow-x: auto; margin: .75rem 0 1rem; }
.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .86rem;
}
.legal-table th,
.legal-table td {
  text-align: left;
  vertical-align: top;
  padding: .65rem .7rem;
  border: 1px solid var(--line);
}
.legal-table th {
  background: #020617;
  color: var(--text);
  font-weight: 700;
}
.legal-table code {
  font-size: .8em;
  color: var(--accent);
}

/* -- Mobile -- */
@media (max-width: 720px) {
  .wrap {
    width: min(960px, calc(100% - 1.25rem));
    padding: 1rem 0 2rem;
  }

  .brand {
    flex-wrap: wrap;
    gap: .5rem .75rem;
    margin-bottom: 1.25rem;
  }
  .tag {
    width: 100%;
    font-size: .78rem;
    order: 3;
  }

  .hero { padding: 0 0 1rem; }
  .eyebrow {
    font-size: .65rem;
    padding: .28rem .6rem;
    max-width: 100%;
    text-align: center;
    line-height: 1.3;
  }
  .hero h1 {
    font-size: clamp(1.65rem, 7.5vw, 2.2rem);
  }
  .hero > p {
    font-size: .95rem;
    margin-bottom: 1rem;
  }

  .cta-row {
    flex-direction: column;
    align-items: stretch;
    gap: .6rem;
  }
  .cta-row .btn,
  .cta-row .btn-ghost {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .feature-grid { margin-top: 1.15rem; gap: .7rem; }
  .feature { padding: .9rem; border-radius: 16px; }

  .hero-art {
    width: 100%;
    max-width: 100%;
    margin-top: 1.1rem;
    border-radius: 14px;
  }

  .how {
    flex-direction: column;
    align-items: stretch;
    gap: .45rem;
  }
  .how li { text-align: center; }

  .card {
    padding: 1rem;
    border-radius: 18px;
  }

  .mode-card {
    min-height: 72px;
    padding: .85rem .9rem;
  }

  .code-giant {
    font-size: clamp(1.8rem, 11vw, 2.6rem);
    letter-spacing: .12em;
    word-break: break-all;
  }

  .room { gap: .85rem; }

  .stage {
    min-height: 0;
    border-radius: 16px;
    /* Prefer a tall phone-friendly stage */
    aspect-ratio: 9 / 14;
    max-height: min(62vh, 520px);
  }
  .stage > video#ez-video {
    min-height: 0;
    width: 100%;
    height: 100%;
    max-height: none;
    /* contain keeps remote screen/camera correctly framed (cover was cropping oddly) */
    object-fit: contain;
    background: #000;
  }
  .local-pip-wrap {
    top: .5rem;
    right: .5rem;
    width: 84px;
    height: 112px;
    border-radius: 10px;
  }
  .local-pip-wrap > video {
    width: 84px !important;
    height: 112px !important;
  }
  .stage-empty { padding: 1rem; font-size: .9rem; }
  .stage-bar {
    right: .5rem;
    bottom: max(.5rem, env(safe-area-inset-bottom, 0px));
    left: auto;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin: .45rem 0 0;
    padding: .4rem 0 calc(.35rem + env(safe-area-inset-bottom));
    background: rgba(7, 11, 20, 0.94);
    border-top: 1px solid var(--line);
    gap: .3rem;
    justify-content: center;
  }
  .actions .btn,
  .actions .btn-sm {
    flex: 0 1 auto;
    min-height: 34px;
    padding: .35rem .65rem;
    font-size: .72rem;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
  }

  .side { padding: .9rem; }
  .stats-grid { gap: .25rem .4rem; font-size: .75rem; }

  .foot { margin-top: 1.75rem; padding-top: 1.15rem; }
  .foot-inner { flex-direction: column; gap: 1rem; }
  .foot-links { gap: .65rem .9rem; }

  .legal { padding: 0; }
  .legal-table { font-size: .78rem; }
}

@media (max-width: 380px) {
  .brand-mark { width: 30px; height: 30px; }
  .logo { font-size: 1.05rem; }
  .actions .btn,
  .actions .btn-sm {
    min-height: 32px;
    padding: .3rem .55rem;
    font-size: .68rem;
  }
}

/* Coarse pointers (phones/tablets): keep stage controls visible */
@media (hover: none) and (pointer: coarse) {
  .stage-bar { opacity: 1; }
  .mode-card:hover { border-color: var(--line); }
  .mode-card.is-on:hover {
    border-color: rgba(34, 211, 238, 0.55);
  }
}

/* Landscape phones: shorter stage, side-by-side CTAs OK */
@media (max-width: 900px) and (orientation: landscape) {
  .stage {
    aspect-ratio: 16 / 9;
    max-height: min(70vh, 360px);
  }
  .stage > video#ez-video { object-fit: contain; }
  .actions {
    position: static;
    background: none;
    border-top: 0;
    padding: .35rem 0 0;
  }
  .cta-row { flex-direction: row; }
  .cta-row .btn { width: auto; flex: 1; }
}

/* Meeting toolbar: keep controls compact on all small screens */
@media (max-width: 720px) {
  #ez-room .actions {
    display: flex;
    flex-wrap: wrap;
    max-height: none;
  }
}
