/* Anam × Fay — meeting-room lightbox.
   Naval-steel blue on charcoal, echoing the Andrea / Marinum brand family. */

:root {
  --bg: #0b0e13;
  --room-bg: #0e1219;
  --panel: #141a23;
  --panel-2: #1a212c;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --ink: #eef2f7;
  --ink-dim: #9aa6b4;
  --ink-faint: #6b7683;
  --accent: #2e6f9e;
  --accent-lift: #6ba8d4;
  --accent-glow: rgba(107, 168, 212, 0.55);
  --danger: #d5533f;
  --danger-lift: #e5715e;
  --ok: #3fb984;
  --radius: 16px;
  --radius-sm: 11px;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; cursor: pointer; }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 13px 22px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.01em;
  transition: transform 0.12s ease, background 0.16s ease, box-shadow 0.16s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: linear-gradient(180deg, var(--accent-lift), var(--accent));
  color: #071019;
  box-shadow: 0 10px 26px -12px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.btn--primary:hover { box-shadow: 0 14px 34px -12px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.28); }
.btn--ghost {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line-2);
  color: var(--ink);
}
.btn--ghost:hover { background: rgba(255, 255, 255, 0.1); }
.btn__mic {
  width: 15px; height: 15px; border-radius: 50%;
  background: #071019;
  box-shadow: 0 0 0 3px rgba(7, 16, 25, 0.25);
}

/* ── Launch screen ────────────────────────────────────────────────────── */
.launch {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(46, 111, 158, 0.22), transparent 60%),
    radial-gradient(800px 500px at 110% 120%, rgba(107, 168, 212, 0.1), transparent 55%),
    var(--bg);
}
.launch__card {
  max-width: 560px;
  text-align: center;
}
.launch__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 22px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-lift); box-shadow: 0 0 12px var(--accent-glow); }
.launch__title {
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.06;
  margin: 0 0 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.launch__title span { color: var(--accent-lift); }
.launch__sub {
  color: var(--ink-dim);
  font-size: 16px;
  line-height: 1.55;
  margin: 0 auto 30px;
  max-width: 460px;
}
.launch__cta { font-size: 16px; padding: 15px 26px; }
.launch__note {
  margin-top: 20px;
  min-height: 18px;
  font-size: 13px;
  color: var(--ink-faint);
}
.launch__note.warn { color: var(--danger-lift); }

/* ── Room (the lightbox) ──────────────────────────────────────────────── */
.room {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  /* Layers, top → bottom: subtle brand glow · dark scrim to keep UI legible ·
     the abstract 3D ambiance image · base color fallback. */
  background:
    radial-gradient(1000px 500px at 50% -5%, rgba(46, 111, 158, 0.14), transparent 60%),
    linear-gradient(rgba(11, 14, 19, 0.80), rgba(11, 14, 19, 0.88)),
    url('/bg-ambiance.jpg') center / cover no-repeat,
    var(--room-bg);
  animation: room-in 0.28s ease both;
}
@keyframes room-in { from { opacity: 0; transform: scale(0.985); } to { opacity: 1; transform: none; } }

.room__bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
}
.room__brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pip { width: 9px; height: 9px; border-radius: 50%; background: var(--accent-lift); box-shadow: 0 0 12px var(--accent-glow); flex: 0 0 auto; }
.room__name { font-size: 14px; color: var(--ink-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room__status {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-dim);
}
.room__statusdot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-faint); transition: background 0.2s; }
.room[data-state="live"] .room__statusdot { background: var(--ok); box-shadow: 0 0 10px rgba(63, 185, 132, 0.7); animation: pulse 1.8s infinite; }
.room[data-state="connecting"] .room__statusdot { background: var(--accent-lift); animation: pulse 1s infinite; }
.room[data-state="ended"] .room__statusdot,
.room[data-state="error"] .room__statusdot { background: var(--danger); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.room__timer {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: var(--ink-faint);
  min-width: 46px;
  text-align: right;
}

/* body: stage + chat */
.room__body { flex: 1 1 auto; display: flex; min-height: 0; }

/* ── Stage ────────────────────────────────────────────────────────────── */
.stage {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  padding: 20px;
  display: grid;
  place-items: center;
}
.tile { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--panel); }

.tile--persona {
  width: min(100%, 900px);
  aspect-ratio: 16 / 10;
  max-height: 100%;
  border: 1px solid var(--line-2);
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.8);
}
.tile__video { width: 100%; height: 100%; object-fit: cover; background: #0a0d12; display: block; }

.tile__glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 0 var(--accent-glow);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.room.is-speaking .tile__glow {
  opacity: 1;
  box-shadow: inset 0 0 0 3px var(--accent-lift), inset 0 0 60px -6px var(--accent-glow);
  animation: breathe 2.4s ease-in-out infinite;
}
@keyframes breathe { 0%, 100% { box-shadow: inset 0 0 0 2px var(--accent-lift), inset 0 0 40px -8px var(--accent-glow); } 50% { box-shadow: inset 0 0 0 3px var(--accent-lift), inset 0 0 75px -4px var(--accent-glow); } }

/* name plate */
.tile__plate {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(8, 12, 18, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--line);
}
.tile__speaking { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-faint); }
.room.is-speaking .tile__speaking { background: var(--accent-lift); box-shadow: 0 0 10px var(--accent-glow); animation: pulse 1s infinite; }

/* self PiP */
.tile--self {
  position: absolute;
  right: 32px;
  bottom: 32px;
  width: clamp(120px, 16vw, 190px);
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line-2);
  box-shadow: 0 16px 40px -20px rgba(0, 0, 0, 0.9);
  display: grid;
  place-items: center;
  z-index: 3;
}
.tile__selfface {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  background: radial-gradient(120% 120% at 50% 20%, #223042, #121821);
}
.tile__selfinitial { color: var(--ink-dim); font-weight: 700; font-size: 15px; letter-spacing: 0.08em; }
.tile__selfhint { font-size: 10.5px; color: var(--ink-faint); letter-spacing: 0.04em; }
.tile__selfvideo {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* mirror, like every conference self-view */
  display: none;
  background: #0a0d12;
}
.tile--self.cam-on .tile__selfvideo { display: block; }
.tile--self.cam-on .tile__selfface { display: none; }
.tile__micstate { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.tile__micstate[data-muted="true"] { background: var(--danger); }

/* overlays shared */
.lobby, .connecting, .ended {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 24px;
  background: radial-gradient(120% 120% at 50% 30%, rgba(20, 28, 40, 0.86), rgba(9, 12, 18, 0.94));
  backdrop-filter: blur(3px);
  z-index: 2;
}
.room[data-state="lobby"] .lobby { display: flex; }
.room[data-state="connecting"] .connecting { display: flex; }
.room[data-state="ended"] .ended { display: flex; }

.lobby__avatar {
  width: 82px; height: 82px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 32px; font-weight: 700; color: #071019;
  background: linear-gradient(160deg, var(--accent-lift), var(--accent));
  box-shadow: 0 0 0 6px rgba(46, 111, 158, 0.16), 0 20px 50px -20px var(--accent-glow);
  margin-bottom: 6px;
}
.lobby__name { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.lobby__role { font-size: 13.5px; color: var(--ink-dim); margin-bottom: 16px; }
.lobby__hint { max-width: 340px; font-size: 13px; color: var(--ink-faint); line-height: 1.5; margin: 12px 0 0; }

.connecting__ring {
  width: 46px; height: 46px; border-radius: 50%;
  border: 3px solid rgba(107, 168, 212, 0.2);
  border-top-color: var(--accent-lift);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.connecting__label { color: var(--ink-dim); font-size: 14px; }

.ended__title { font-size: 20px; font-weight: 700; margin-bottom: 6px; }

/* ── Chat ─────────────────────────────────────────────────────────────── */
.chat {
  flex: 0 0 340px;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: var(--panel);
  min-height: 0;
}
.room.chat-hidden .chat { display: none; }
.chat__head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-dim);
  border-bottom: 1px solid var(--line);
}
.chat__close { background: none; border: none; color: var(--ink-dim); font-size: 22px; line-height: 1; padding: 0 4px; }
.chat__close:hover { color: var(--ink); }
.chat__log {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat__empty { color: var(--ink-faint); font-size: 13px; text-align: center; margin: auto 0; }
.bubble {
  max-width: 88%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  animation: bubble-in 0.18s ease both;
}
@keyframes bubble-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.bubble__who { display: block; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.6; margin-bottom: 3px; }
.bubble--fay { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.bubble--you { align-self: flex-end; background: linear-gradient(180deg, var(--accent), #255b82); color: #f2f8ff; border-bottom-right-radius: 5px; }

.chat__composer { flex: 0 0 auto; display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.chat__input {
  flex: 1 1 auto;
  background: var(--room-bg);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 11px 15px;
  color: var(--ink);
  font-size: 14px;
  outline: none;
}
.chat__input:focus { border-color: var(--accent); }
.chat__input:disabled { opacity: 0.5; }
.chat__send {
  flex: 0 0 auto;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #04121d;
  display: grid; place-items: center;
}
.chat__send:disabled { opacity: 0.4; cursor: default; }
.chat__send:not(:disabled):hover { background: var(--accent-lift); }

/* ── Controls ─────────────────────────────────────────────────────────── */
.controls {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 16px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.22));
}
.ctl {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 70px;
  padding: 9px 10px;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  color: var(--ink);
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.ctl:hover { background: var(--panel-2); }
.ctl:disabled { opacity: 0.4; cursor: default; }
.ctl__label { font-size: 11.5px; color: var(--ink-dim); }
.ctl__ico {
  width: 22px; height: 22px;
  background: currentColor;
  -webkit-mask: center / contain no-repeat;
  mask: center / contain no-repeat;
}
.ctl__ico--mic { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 15a3 3 0 0 0 3-3V6a3 3 0 1 0-6 0v6a3 3 0 0 0 3 3Zm5-3a5 5 0 0 1-10 0H5a7 7 0 0 0 6 6.92V22h2v-3.08A7 7 0 0 0 19 12h-2Z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 15a3 3 0 0 0 3-3V6a3 3 0 1 0-6 0v6a3 3 0 0 0 3 3Zm5-3a5 5 0 0 1-10 0H5a7 7 0 0 0 6 6.92V22h2v-3.08A7 7 0 0 0 19 12h-2Z'/%3E%3C/svg%3E"); }
.ctl[data-muted="true"] { color: var(--danger-lift); border-color: rgba(213, 83, 63, 0.5); }
.ctl[data-muted="true"] .ctl__ico--mic { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M15 10.6V6a3 3 0 0 0-5.9-.75L15 10.6ZM4.27 3 3 4.27l6 6V12a3 3 0 0 0 4.53 2.58l1.1 1.1A5 5 0 0 1 7 12H5a7 7 0 0 0 6 6.92V22h2v-3.08a6.9 6.9 0 0 0 2.3-.72l3.43 3.43L20 20.36 4.27 3Z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M15 10.6V6a3 3 0 0 0-5.9-.75L15 10.6ZM4.27 3 3 4.27l6 6V12a3 3 0 0 0 4.53 2.58l1.1 1.1A5 5 0 0 1 7 12H5a7 7 0 0 0 6 6.92V22h2v-3.08a6.9 6.9 0 0 0 2.3-.72l3.43 3.43L20 20.36 4.27 3Z'/%3E%3C/svg%3E"); }
.ctl__ico--chat { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 4h16a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H9l-5 4V5a1 1 0 0 1 1-1Z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 4h16a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H9l-5 4V5a1 1 0 0 1 1-1Z'/%3E%3C/svg%3E"); }
.ctl__ico--cam { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17 10.5V7a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-3.5l4 4v-11l-4 4Z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17 10.5V7a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-3.5l4 4v-11l-4 4Z'/%3E%3C/svg%3E"); }
.ctl[data-off="true"] .ctl__ico--cam { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3.28 2 2 3.28 4.7 6H4a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h12c.2 0 .38-.06.54-.16L20.72 22 22 20.72 3.28 2ZM17 10.5V7a1 1 0 0 0-1-1H9.28l7.72 7.72V14l4 4V6.5l-4 4Z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3.28 2 2 3.28 4.7 6H4a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h12c.2 0 .38-.06.54-.16L20.72 22 22 20.72 3.28 2ZM17 10.5V7a1 1 0 0 0-1-1H9.28l7.72 7.72V14l4 4V6.5l-4 4Z'/%3E%3C/svg%3E"); }
.ctl[data-off="true"] .ctl__ico--cam { color: var(--ink-dim); }
.ctl__ico--leave { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 9c-1.6 0-3.16.25-4.61.72v3.1c0 .4-.23.74-.56.9-.98.49-1.88 1.12-2.67 1.85a1 1 0 0 1-1.39-.02L.29 13.6a1 1 0 0 1 0-1.4C3.32 9.28 7.44 8 12 8s8.68 1.28 11.71 4.19a1 1 0 0 1 0 1.4l-2.48 2.86a1 1 0 0 1-1.39.02c-.8-.73-1.69-1.36-2.67-1.85a1 1 0 0 1-.56-.9v-3.1A16.5 16.5 0 0 0 12 9Z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 9c-1.6 0-3.16.25-4.61.72v3.1c0 .4-.23.74-.56.9-.98.49-1.88 1.12-2.67 1.85a1 1 0 0 1-1.39-.02L.29 13.6a1 1 0 0 1 0-1.4C3.32 9.28 7.44 8 12 8s8.68 1.28 11.71 4.19a1 1 0 0 1 0 1.4l-2.48 2.86a1 1 0 0 1-1.39.02c-.8-.73-1.69-1.36-2.67-1.85a1 1 0 0 1-.56-.9v-3.1A16.5 16.5 0 0 0 12 9Z'/%3E%3C/svg%3E"); }
.ctl--leave { color: #fff; background: var(--danger); border-color: transparent; }
.ctl--leave:hover { background: var(--danger-lift); }
.ctl--leave .ctl__label { color: rgba(255, 255, 255, 0.85); }

/* error bar */
.room__err {
  position: absolute;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%);
  max-width: 90%;
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(213, 83, 63, 0.14);
  border: 1px solid rgba(213, 83, 63, 0.5);
  color: var(--danger-lift);
  font-size: 13.5px;
  text-align: center;
}

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .room__body { flex-direction: column; }
  .chat {
    position: absolute;
    inset: 52px 0 84px;
    flex-basis: auto;
    z-index: 6;
    border-left: none;
    border-top: 1px solid var(--line);
  }
  .room:not(.chat-open) .chat { display: none; }
  .tile--self { right: 16px; bottom: 16px; }
  .stage { padding: 12px; }
}
