:root {
  --bg: #070a12;
  --surface: #101522;
  --surface-2: #171d2c;
  --surface-3: #20273a;
  --border: rgba(255,255,255,.09);
  --text: #f6f8ff;
  --muted: #9ca8c7;
  --blue: #4c7dff;
  --violet: #815cff;
  --danger: #ef4c57;
  --green: #31c78a;
  --shadow: 0 24px 80px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif; color: var(--text); background: var(--bg); }
button, input { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

body.landing {
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% 20%, rgba(76,125,255,.14), transparent 35%),
    radial-gradient(circle at 88% 28%, rgba(129,92,255,.14), transparent 34%),
    #070a12;
}

.ambient {
  position: fixed;
  width: 520px;
  height: 520px;
  filter: blur(110px);
  border-radius: 50%;
  opacity: .15;
  pointer-events: none;
}
.ambient-a { left: -240px; top: 120px; background: #4c7dff; }
.ambient-b { right: -220px; top: 0; background: #815cff; }

.topbar, .meeting-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  padding: 0 40px;
  position: relative;
  z-index: 2;
}

.topbar { justify-content: space-between; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 19px;
  font-weight: 800;
  color: white;
  text-decoration: none;
}
.brand.compact { font-size: 16px; }
.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  box-shadow: 0 10px 35px rgba(76,125,255,.25);
  font-weight: 900;
}

.secure-pill {
  color: #c7d2ee;
  background: rgba(255,255,255,.055);
  border: 1px solid var(--border);
  padding: 9px 13px;
  border-radius: 999px;
  font-size: 13px;
}

.hero {
  min-height: calc(100vh - 72px);
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  align-items: center;
  gap: 72px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 70px 40px 110px;
  position: relative;
  z-index: 1;
}

.eyebrow {
  color: #8facff;
  font-weight: 800;
  letter-spacing: .16em;
  font-size: 12px;
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(42px, 5vw, 72px);
  line-height: 1.02;
  letter-spacing: -.045em;
  margin: 0 0 24px;
  max-width: 760px;
}

.lead {
  color: var(--muted);
  font-size: 19px;
  line-height: 1.7;
  max-width: 700px;
}

.meeting-actions {
  display: flex;
  gap: 14px;
  margin-top: 34px;
  flex-wrap: wrap;
}

.btn {
  border: 0;
  border-radius: 12px;
  min-height: 48px;
  padding: 0 20px;
  font-weight: 750;
  transition: .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  box-shadow: 0 12px 34px rgba(76,125,255,.22);
}
.btn-ghost {
  color: #e7ebf9;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
}
.btn.small { min-height: 38px; padding: 0 14px; font-size: 13px; }
.btn.full { width: 100%; }

.join-form {
  display: flex;
  background: rgba(255,255,255,.045);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.join-form input {
  width: 220px;
  background: transparent;
  color: white;
  border: 0;
  outline: none;
  padding: 0 14px;
}
.join-form .btn { border-radius: 0; background: transparent; border: 0; }

.feature-strip {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  color: #b7c2df;
  font-size: 13px;
  margin-top: 28px;
}

.hero-card {
  display: grid;
  place-items: center;
}

.mock-window {
  width: min(590px, 100%);
  padding: 14px;
  border: 1px solid var(--border);
  background: rgba(15,20,34,.72);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  border-radius: 24px;
  transform: perspective(1000px) rotateY(-4deg) rotateX(2deg);
}

.mock-bar { display: flex; gap: 6px; padding: 4px 0 12px 4px; }
.mock-bar span { width: 8px; height: 8px; border-radius: 50%; background: #3d465f; }

.mock-grid {
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  grid-template-rows: 1fr 1fr;
  gap: 10px;
  min-height: 370px;
}
.mock-person {
  border-radius: 16px;
  background: linear-gradient(145deg, #181f31, #111625);
  border: 1px solid rgba(255,255,255,.055);
  display: flex;
  align-items: flex-end;
  padding: 18px;
  gap: 10px;
}
.mock-person.large { grid-row: 1 / 3; justify-content: center; align-items: center; flex-direction: column; }
.avatar {
  width: 80px; height: 80px; display: grid; place-items: center; border-radius: 50%;
  background: linear-gradient(135deg,#3f78ff,#8a5dff); font-weight: 900; font-size: 22px;
}
.avatar.alt { width: 48px; height: 48px; font-size: 15px; background: linear-gradient(135deg,#15b08b,#3b82f6); }
.avatar.alt2 { width: 48px; height: 48px; font-size: 15px; background: linear-gradient(135deg,#ea6c3b,#d946ef); }

.mock-controls {
  margin-top: 13px;
  display: flex;
  justify-content: center;
  gap: 10px;
}
.mock-controls i {
  width: 43px; height: 43px; border-radius: 50%; display: grid; place-items: center;
  background: #242b3d; font-style: normal;
}
.mock-controls i.hangup { background: var(--danger); }

.prejoin {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 30px;
  background:
    radial-gradient(circle at 50% 0, rgba(76,125,255,.13), transparent 35%),
    #080b12;
}
.prejoin-card {
  width: min(520px, 100%);
  border: 1px solid var(--border);
  border-radius: 22px;
  background: #0f1420;
  padding: 26px;
  box-shadow: var(--shadow);
}
.prejoin-brand { margin-bottom: 20px; }
.preview-wrap {
  aspect-ratio: 16/9;
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: #05070c;
  border: 1px solid var(--border);
}
.preview-wrap video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.preview-off {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: #8792ad; background: #0a0e17;
}
.prejoin-card h2 { margin: 22px 0 4px; font-size: 28px; }
.muted { color: var(--muted); }
.name-input {
  width: 100%;
  min-height: 50px;
  background: #171d2a;
  border: 1px solid var(--border);
  color: white;
  border-radius: 12px;
  outline: none;
  padding: 0 14px;
  margin: 14px 0;
}
.prejoin-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 8px 0 20px;
}
.circle-btn, .control-btn {
  border: 1px solid var(--border);
  color: white;
  background: #282f40;
  display: inline-grid;
  place-items: center;
  transition: .15s ease;
}
.circle-btn { width: 48px; height: 48px; border-radius: 50%; }
.circle-btn.off, .control-btn.off { background: var(--danger); }
.error { min-height: 20px; color: #ff8791; margin: 12px 0 0; font-size: 13px; }

.meeting-page { overflow: hidden; }
.meeting-app { height: 100vh; display: flex; flex-direction: column; background: #07090e; }
.meeting-header {
  height: 64px;
  min-height: 64px;
  padding: 0 18px;
  background: #0a0d14;
  border-bottom: 1px solid rgba(255,255,255,.06);
  justify-content: space-between;
}
.meeting-meta { color: #acb6ce; font-size: 13px; display: flex; gap: 8px; align-items: center; }
.dot { opacity: .45; }
.meeting-main { min-height: 0; flex: 1; display: flex; }
.stage { min-width: 0; flex: 1; display: flex; flex-direction: column; padding: 14px 14px 12px; }
.video-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(min(380px,100%), 1fr));
  grid-auto-rows: minmax(180px, 1fr);
  align-content: center;
}
.video-tile {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background: #111620;
  border: 1px solid rgba(255,255,255,.055);
  min-height: 0;
}
.video-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #0b0f17;
}
.video-tile.local video { transform: scaleX(-1); }
.video-tile.presenting video { transform: none !important; object-fit: contain; }
.tile-label {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 9px;
  background: rgba(5,8,14,.72);
  backdrop-filter: blur(8px);
  font-size: 12px;
}
.tile-badges { display: inline-flex; gap: 5px; }

.video-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 40%, #182033, #10141f 64%);
}
.video-placeholder .avatar-big {
  width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center;
  font-size: 23px; font-weight: 900;
  background: linear-gradient(135deg, #4579ff, #875bff);
}

.bottom-bar {
  height: 78px;
  min-height: 78px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.bottom-left { color: #a4aec5; font-size: 13px; padding-left: 6px; }
.control-cluster { display: flex; gap: 9px; }
.control-cluster.right { justify-content: flex-end; }
.control-btn {
  min-width: 48px;
  height: 48px;
  padding: 0 13px;
  border-radius: 999px;
  font-size: 17px;
}
.control-btn:hover { background: #353d50; }
.control-btn.active { background: #2d3547; }
.control-btn.danger { background: var(--danger); width: 66px; }

.side-panel {
  width: 365px;
  min-width: 365px;
  background: #111621;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.panel-head {
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
}
.panel-head h3 { margin: 0; }
.panel-head small { color: var(--muted); }
.icon-btn {
  background: transparent; border: 0; color: #dce2f1; width: 38px; height: 38px; border-radius: 50%;
}
.icon-btn:hover { background: rgba(255,255,255,.07); }

.panel-content { min-height: 0; flex: 1; overflow: auto; padding: 14px; }
.host-controls { padding-bottom: 12px; }
.participant {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-radius: 12px;
}
.participant:hover { background: rgba(255,255,255,.035); }
.mini-avatar {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: #273047; font-size: 12px; font-weight: 800;
}
.participant-meta { flex: 1; min-width: 0; }
.participant-name { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.participant-status { color: var(--muted); font-size: 11px; margin-top: 2px; }
.participant-actions { display: flex; gap: 4px; }
.tiny-btn {
  border: 0; border-radius: 8px; background: #222a3b; color: #d7deef; min-height: 30px; padding: 0 8px; font-size: 11px;
}
.tiny-btn.danger { color: #ff8c95; }

#chatPanel { display: flex; flex-direction: column; padding: 0; }
.chat-messages { flex: 1; min-height: 0; overflow: auto; padding: 14px; }
.chat-message { margin: 0 0 16px; }
.chat-message .msg-head { color: #a7b3ce; font-size: 11px; margin-bottom: 5px; }
.chat-message .msg-text { font-size: 13px; line-height: 1.5; color: #eef1f9; overflow-wrap: anywhere; }
.chat-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
}
.chat-form input {
  flex: 1;
  min-width: 0;
  min-height: 45px;
  border: 1px solid var(--border);
  background: #1a2030;
  color: white;
  border-radius: 12px;
  outline: none;
  padding: 0 12px;
}
.send-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--blue); color: white;
}

.more-menu {
  position: fixed;
  right: 20px;
  bottom: 86px;
  width: 220px;
  border-radius: 13px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #171c29;
  box-shadow: var(--shadow);
  z-index: 20;
}
.more-menu button {
  width: 100%; display: block; text-align: left; min-height: 44px; padding: 0 13px;
  background: transparent; color: #e6ebf7; border: 0;
}
.more-menu button:hover { background: rgba(255,255,255,.06); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 94px;
  transform: translateX(-50%);
  padding: 11px 15px;
  border-radius: 10px;
  background: #e9eefc;
  color: #10131b;
  font-size: 13px;
  font-weight: 700;
  z-index: 50;
  box-shadow: var(--shadow);
}

@media (max-width: 920px) {
  .hero { grid-template-columns: 1fr; padding-top: 35px; }
  .hero-card { order: -1; }
  .mock-window { transform: none; }
  .mock-grid { min-height: 300px; }
  .feature-strip { gap: 12px 18px; }
  .side-panel { position: fixed; inset: 64px 0 0 auto; z-index: 30; width: min(390px, 100vw); min-width: 0; }
}

@media (max-width: 700px) {
  .topbar { padding: 0 18px; }
  .secure-pill { display: none; }
  .hero { padding: 30px 18px 70px; gap: 38px; }
  .hero h1 { font-size: 45px; }
  .meeting-actions { display: grid; }
  .join-form input { width: 100%; }
  .mock-grid { min-height: 230px; }
  .meeting-header .brand span:last-child { display: none; }
  .meeting-meta .dot, #meetingTimer { display: none; }
  .meeting-header { padding: 0 10px; }
  .stage { padding: 8px; }
  .video-grid { grid-template-columns: 1fr; grid-auto-rows: minmax(150px, 1fr); }
  .bottom-bar { grid-template-columns: auto 1fr auto; height: 72px; min-height: 72px; }
  .bottom-left { display: none; }
  .control-cluster { gap: 5px; }
  .control-btn { min-width: 42px; width: 42px; height: 42px; padding: 0; font-size: 15px; }
  #handBtn, #peopleBtn span { display: none; }
  .control-cluster.right #moreBtn { display: none; }
}
