/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --bg: #F1EEF8;
  --surface: #FFFFFF;
  --surface-2: #E7E2F3;
  --text: #1B1530;
  --muted: #5E557A;
  --line: #D6CFE8;
  --marigold: #F2A93B;
  --marigold-ink: #2A1A00;
  --marigold-text: #9A5F05;
  --rose: #D9406B;
  --rose-soft: #FBE3EA;
  --stage: #1B1530;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 28px;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #1B1530;
    --surface: #251D41;
    --surface-2: #31285A;
    --text: #F7F1E6;
    --muted: #B3A9CF;
    --line: #3D3366;
    --marigold-text: #F2A93B;
    --rose: #EE6A8F;
    --rose-soft: #3E2142;
    --stage: #120E22;
  }
}
*, *::before, *::after { box-sizing: inherit; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--marigold-text); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--marigold); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
svg { width: 1.25em; height: 1.25em; fill: currentColor; flex: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  font: 600 1rem/1 var(--body);
  border: 0; border-radius: 999px;
  padding: .8em 1.3em;
  cursor: pointer;
  transition: transform .12s ease, background-color .15s ease, box-shadow .15s ease;
  text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-lg { font-size: 1.06rem; padding: 1em 1.6em; }
.btn-primary { background: var(--marigold); color: var(--marigold-ink); box-shadow: 0 6px 0 -2px #C27C12; }
.btn-primary:hover:not(:disabled) { background: #F6B957; }
.btn-ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 2px var(--line); }
.btn-ghost:hover { box-shadow: inset 0 0 0 2px var(--muted); }
.btn-danger { background: var(--rose); color: #fff; }

/* ---------- Brand / top bar ---------- */
.topbar, .chat-top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.1rem clamp(1rem, 4vw, 3rem);
}
.brand {
  display: inline-flex; align-items: center; gap: .55rem;
  font: 800 1.45rem/1 var(--display); letter-spacing: -.045em;
  color: var(--text); text-decoration: none;
}
.brand-sm { font-size: 1.15rem; }
.brand-mark { display: inline-block; width: 1.3em; height: 1.3em; background: url("/logo-mark.svg") center / contain no-repeat; flex: none; }
.brand-mark i { display: none; }
.online-pill {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .9rem; font-weight: 600; color: var(--muted);
  background: var(--surface); padding: .4rem .8rem; border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.online-count { color: var(--text); font-variant-numeric: tabular-nums; }
.dot { width: .5rem; height: .5rem; border-radius: 50%; background: #3BC47A; box-shadow: 0 0 0 3px rgba(59,196,122,.22); }

/* ---------- Landing ---------- */
.landing { min-height: 100%; display: flex; flex-direction: column; }
.hero {
  flex: 1;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(2rem, 5vw, 5rem); align-items: center;
  padding: clamp(1.5rem, 5vw, 4rem) clamp(1rem, 4vw, 3rem);
  max-width: 1240px; margin: 0 auto; width: 100%;
}
.hero h1 {
  font: 800 clamp(2.6rem, 6.2vw, 4.9rem)/.98 var(--display);
  letter-spacing: -.035em;
  margin: 0 0 1.2rem;
  max-width: 13ch;
  text-wrap: balance;
}
.lede { font-size: 1.15rem; color: var(--muted); max-width: 46ch; margin: 0 0 2rem; }

.start-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: clamp(1.2rem, 3vw, 1.8rem);
  box-shadow: inset 0 0 0 1px var(--line);
  max-width: 560px;
}
.field-label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: .5rem; }
.optional { font-weight: 400; color: var(--muted); }
.chips-input {
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem;
  background: var(--bg); border-radius: var(--r-md);
  padding: .5rem .6rem; min-height: 3rem;
  box-shadow: inset 0 0 0 1.5px var(--line);
  cursor: text;
}
.chips-input:focus-within { box-shadow: inset 0 0 0 2px var(--marigold); }
.chip-list { display: contents; list-style: none; margin: 0; padding: 0; }
.chip {
  display: inline-flex; align-items: center; gap: .3rem;
  background: var(--surface-2); color: var(--text);
  border-radius: 999px; padding: .25rem .35rem .25rem .7rem; font-size: .9rem; font-weight: 600;
}
.chip button {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  width: 1.4rem; height: 1.4rem; border-radius: 50%; font-size: 1rem; line-height: 1;
}
.chip button:hover { background: var(--line); color: var(--text); }
.chips-input input {
  flex: 1; min-width: 8rem; border: 0; outline: 0; background: transparent;
  font: inherit; color: var(--text); padding: .35rem .2rem;
}
.consent { display: flex; gap: .7rem; align-items: flex-start; margin: 1.2rem 0 .4rem; font-size: .97rem; cursor: pointer; }
.consent input { width: 1.25rem; height: 1.25rem; margin-top: .15rem; accent-color: var(--marigold); flex: none; }
.form-error { color: var(--rose); font-weight: 600; font-size: .93rem; margin: .5rem 0 0; }
.start-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.3rem; }

/* Hero art: two windows drifting into each other once on load */
.hero-art { position: relative; aspect-ratio: 1 / .92; max-width: 520px; width: 100%; justify-self: center; }
.frame {
  position: absolute; width: 64%; aspect-ratio: 4 / 3.3;
  border-radius: var(--r-lg); overflow: hidden;
  box-shadow: 0 24px 60px -24px rgba(27,21,48,.45);
}
.frame-you { left: 0; top: 4%; background: #F2A93B; transform: rotate(-4deg); animation: drift-in-left 1.1s cubic-bezier(.2,.8,.2,1) both; }
.frame-them { right: 0; bottom: 4%; background: #6B4FD8; transform: rotate(3deg); animation: drift-in-right 1.1s cubic-bezier(.2,.8,.2,1) .1s both; }
.frame-tag {
  position: absolute; left: 1rem; bottom: 1rem; z-index: 2;
  font: 700 .9rem/1 var(--body); color: #1B1530;
  background: rgba(255,255,255,.88); padding: .45rem .75rem; border-radius: 999px;
}
.blob { position: absolute; border-radius: 50%; }
.b1 { width: 46%; aspect-ratio: 1; left: 27%; top: 18%; background: #FFD9A0; box-shadow: 0 120px 0 40px #E08F1C; }
.b2 { width: 46%; aspect-ratio: 1; left: 27%; top: 18%; background: #C8B8FF; box-shadow: 0 120px 0 40px #4A33B5; }
.spark {
  position: absolute; left: 50%; top: 50%; width: 3.6rem; height: 3.6rem; margin: -1.8rem 0 0 -1.8rem;
  background: var(--rose); border-radius: 50%; z-index: 3;
  box-shadow: 0 0 0 8px var(--bg);
  animation: pop .5s cubic-bezier(.3,1.6,.5,1) 1s both;
}
.spark::after { content: "hi!"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font: 800 1.15rem/1 var(--display); }
@keyframes drift-in-left { from { transform: translate(-18%, 6%) rotate(-12deg); opacity: 0; } }
@keyframes drift-in-right { from { transform: translate(18%, -6%) rotate(10deg); opacity: 0; } }
@keyframes pop { from { transform: scale(0); } }

.rules {
  max-width: 1240px; margin: 0 auto; width: 100%;
  padding: 1rem clamp(1rem, 4vw, 3rem) 2rem;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 2rem; align-items: start;
}
.rules h2 { font: 700 1.6rem/1.15 var(--display); letter-spacing: -.02em; margin: 0; }
.rules p { margin: 0; color: var(--muted); max-width: 62ch; }
.site-footer {
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between;
  padding: 1.2rem clamp(1rem, 4vw, 3rem); color: var(--muted); font-size: .9rem;
  border-top: 1px solid var(--line);
}

/* ---------- Chat ---------- */
.chat {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "top top" "stage chat";
}
.chat-top { grid-area: top; padding-block: .7rem; }
.status-line { margin: 0; font-weight: 600; color: var(--muted); text-align: center; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage { grid-area: stage; display: flex; flex-direction: column; gap: .8rem; padding: 0 .8rem .8rem clamp(.8rem, 2vw, 1.5rem); min-height: 0; }
.remote-wrap {
  position: relative; flex: 1; min-height: 0;
  background: var(--stage); border-radius: var(--r-lg); overflow: hidden;
}
#remoteVideo { width: 100%; height: 100%; object-fit: contain; display: block; background: var(--stage); }
.remote-overlay {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: var(--stage); color: #F7F1E6; text-align: center; padding: 1rem;
}
.remote-overlay p { margin: 1.2rem 0 1rem; font: 600 1.15rem/1.3 var(--display); }
.orbit { position: relative; width: 84px; height: 60px; margin: 0 auto; }
.orbit i { position: absolute; width: 44px; height: 36px; border-radius: 10px; }
.orbit i:first-child { background: var(--marigold); left: 0; top: 0; animation: swap 1.6s ease-in-out infinite; }
.orbit i:last-child { background: #EE6A8F; right: 0; bottom: 0; animation: swap 1.6s ease-in-out infinite reverse; }
.searching.idle .orbit i { animation: none; }
@keyframes swap { 50% { transform: translate(40px, 24px); } }
.local-wrap {
  position: absolute; right: 1rem; bottom: 1rem;
  width: clamp(110px, 22%, 240px); aspect-ratio: 4 / 3;
  border-radius: var(--r-md); overflow: hidden; background: #31285A;
  box-shadow: 0 0 0 3px rgba(255,255,255,.12), 0 12px 30px rgba(0,0,0,.4);
  z-index: 2;
}
#localVideo { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.cam-off-label { position: absolute; inset: 0; display: grid; place-items: center; color: #B3A9CF; font-size: .85rem; font-weight: 600; background: #31285A; }
.chat.text-mode .local-wrap { display: none; }

.controls { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.ctrl {
  display: inline-flex; flex-direction: column; align-items: center; gap: .2rem;
  background: var(--surface); color: var(--text);
  border: 0; border-radius: var(--r-md); padding: .55rem .8rem; min-width: 4.2rem;
  font: 600 .78rem/1 var(--body); cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--line);
}
.ctrl:hover:not(:disabled) { background: var(--surface-2); }
.ctrl:disabled { opacity: .4; cursor: not-allowed; }
.ctrl .off { display: none; }
.ctrl[aria-pressed="true"] { background: var(--rose-soft); color: var(--rose); }
.ctrl[aria-pressed="true"] .on { display: none; }
.ctrl[aria-pressed="true"] .off { display: inline; }
.ctrl-danger { color: var(--rose); }
.chat.text-mode #micBtn, .chat.text-mode #camBtn { display: none; }
.btn-next { margin-left: auto; padding-inline: 2rem; font-size: 1.05rem; }
kbd {
  font: 600 .7rem/1 var(--body); padding: .25rem .4rem; border-radius: 6px;
  background: rgba(42,26,0,.14);
}

.chatbox {
  grid-area: chat; display: flex; flex-direction: column; min-height: 0;
  background: var(--surface); margin: 0 clamp(.8rem, 2vw, 1.5rem) .8rem 0;
  border-radius: var(--r-lg); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden;
}
.messages { flex: 1; overflow-y: auto; list-style: none; margin: 0; padding: 1rem; display: flex; flex-direction: column; gap: .45rem; }
.msg { max-width: 85%; padding: .55rem .85rem; border-radius: 18px; overflow-wrap: anywhere; font-size: .97rem; line-height: 1.4; }
.msg.me { align-self: flex-end; background: var(--marigold); color: var(--marigold-ink); border-bottom-right-radius: 6px; }
.msg.them { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 6px; }
.msg.system { align-self: center; max-width: 100%; text-align: center; background: none; color: var(--muted); font-size: .88rem; padding: .3rem .5rem; }
.msg.system strong { color: var(--text); }
.typing { margin: 0; padding: 0 1rem .4rem; color: var(--muted); font-size: .85rem; font-style: italic; }
.msg-form { display: flex; gap: .5rem; padding: .7rem; border-top: 1px solid var(--line); }
.msg-form input {
  flex: 1; min-width: 0; font: inherit; color: var(--text);
  background: var(--bg); border: 0; border-radius: 999px; padding: .75rem 1rem;
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.msg-form input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--marigold); }

/* Text-only layout: chat takes the main area */
.chat.text-mode { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); grid-template-areas: "top" "stage" "chat"; }
.chat.text-mode .remote-wrap { flex: none; height: 0; }
.chat.text-mode .remote-wrap:has(.remote-overlay:not([hidden])) { height: 180px; }
.chat.text-mode .chatbox { margin: 0 auto .8rem; width: calc(100% - 2rem); max-width: 760px; }
.chat.text-mode .stage { max-width: 760px; width: 100%; margin: 0 auto; padding: 0 0 .8rem; }

/* ---------- Dialog ---------- */
.dialog {
  border: 0; border-radius: var(--r-lg); padding: 1.6rem; width: min(460px, calc(100% - 2rem));
  background: var(--surface); color: var(--text); box-shadow: 0 30px 80px rgba(0,0,0,.35);
}
.dialog::backdrop { background: rgba(18,14,34,.6); }
.dialog h2 { font: 700 1.5rem/1.15 var(--display); margin: 0 0 .4rem; }
.dialog .muted { margin: 0 0 1rem; font-size: .95rem; }
.reasons { border: 0; padding: 0; margin: 0 0 1rem; display: grid; gap: .3rem; }
.reasons label { display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; border-radius: var(--r-sm); cursor: pointer; }
.reasons label:hover { background: var(--surface-2); }
.reasons input { accent-color: var(--rose); width: 1.1rem; height: 1.1rem; }
.dialog textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--bg);
  border: 0; border-radius: var(--r-md); padding: .7rem; resize: vertical; box-shadow: inset 0 0 0 1.5px var(--line);
}
.dialog-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.2rem; }

/* ---------- Banned & toast ---------- */
.banned { min-height: 100%; display: grid; place-content: center; text-align: center; padding: 2rem; }
.banned h1 { font: 800 clamp(2rem, 5vw, 3.2rem)/1 var(--display); margin: 0 0 1rem; }
.banned p { color: var(--muted); max-width: 44ch; margin: 0 auto; }
.toast {
  position: fixed; left: 50%; bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: var(--text); color: var(--bg); font-weight: 600; font-size: .95rem;
  padding: .75rem 1.2rem; border-radius: 999px; z-index: 50; max-width: calc(100% - 2rem); text-align: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { max-width: 380px; order: -1; }
  .rules { grid-template-columns: 1fr; gap: .8rem; }
  .chat {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1.25fr) minmax(0, 1fr);
    grid-template-areas: "top" "stage" "chat";
  }
  .stage { padding: 0 .6rem .6rem; }
  .chatbox { margin: 0 .6rem .6rem; }
  .status-line { font-size: .9rem; }
  .chat-top .online-pill { display: none; }
}
@media (max-width: 560px) {
  .start-actions .btn { flex: 1 1 100%; }
  .ctrl { min-width: 0; padding: .55rem .6rem; }
  .ctrl-label { display: none; }
  .btn-next { padding-inline: 1.3rem; }
  .btn-next kbd { display: none; }
  .local-wrap { width: 34%; right: .6rem; bottom: .6rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ================= v2: accounts, premium, filters ================= */
.btn-sm { padding: .55em 1em; font-size: .92rem; }
.btn-block { width: 100%; }
.top-right { display: flex; align-items: center; gap: .8rem; }
.acct { display: flex; align-items: center; gap: .5rem; }
.acct-name { font-weight: 600; max-width: 12ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.premium-badge {
  border: 0; cursor: pointer; font: 700 .85rem/1 var(--body);
  padding: .5rem .8rem; border-radius: 999px;
  background: var(--surface); color: var(--marigold-text); box-shadow: inset 0 0 0 1.5px var(--marigold);
}
.premium-badge.is-premium { background: var(--marigold); color: var(--marigold-ink); box-shadow: none; }
.link-btn { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--marigold-text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.card-title { font: 700 1.35rem/1.2 var(--display); margin: 0 0 .4rem; letter-spacing: -.01em; }
.card-sub { margin: 0; max-width: 48ch; }
.start-card .start-actions { margin-top: 1.2rem; }

.filter-group { border: 0; padding: 0; margin: .9rem 0 1.1rem; }
.segmented {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  background: var(--bg); padding: 4px; border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--line);
}
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.segmented span {
  display: flex; align-items: center; justify-content: center; gap: .35rem;
  padding: .6rem .5rem; border-radius: 999px; font-weight: 600; font-size: .95rem; color: var(--muted);
  transition: background-color .15s ease, color .15s ease;
}
.segmented input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 0 var(--line), 0 2px 8px rgba(27,21,48,.12); }
.segmented input:focus-visible + span { outline: 3px solid var(--marigold); outline-offset: 1px; }
.lock { font-style: normal; color: var(--marigold-text); font-size: .85em; }
.is-premium-user .lock { display: none; }
.filter-hint { margin: .45rem 0 0; font-size: .88rem; color: var(--muted); }
.is-premium-user .filter-hint { display: none; }

.perks {
  max-width: 1240px; margin: 0 auto 1rem; width: calc(100% - 2 * clamp(1rem, 4vw, 3rem));
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
  background: var(--surface); border-radius: var(--r-lg); padding: 1.4rem 1.6rem;
  box-shadow: inset 0 0 0 1.5px var(--marigold);
}
.perks h2 { font: 700 1.3rem/1.2 var(--display); margin: 0 0 .3rem; }
.perks p { margin: 0; color: var(--muted); max-width: 60ch; }

/* Chat additions */
.stranger-tag {
  position: absolute; left: 1rem; top: 1rem; z-index: 2;
  font: 700 .85rem/1 var(--body); color: #1B1530;
  background: rgba(255,255,255,.9); padding: .45rem .75rem; border-radius: 999px;
}
.ctrl-select { position: relative; }
.ctrl-select select {
  border: 0; background: transparent; color: var(--text); font: 600 .85rem/1 var(--body);
  padding: .15rem 0; cursor: pointer; max-width: 7.5rem;
}
.ctrl-select select option { color: #1B1530; }
.chat.text-mode .ctrl-select { display: inline-flex; }

/* Dialog additions */
.dialog { position: relative; }
.dialog-close {
  position: absolute; right: .8rem; top: .8rem; width: 2.2rem; height: 2.2rem; border-radius: 50%;
  border: 0; background: var(--surface-2); color: var(--text); font-size: 1.3rem; line-height: 1; cursor: pointer;
}
.dialog-auth, .dialog-premium { width: min(440px, calc(100% - 1.5rem)); max-height: calc(100dvh - 2rem); overflow-y: auto; }
.tabs { display: flex; gap: 1.2rem; margin: 0 2.5rem 1.2rem 0; border-bottom: 1.5px solid var(--line); }
.tabs button {
  border: 0; background: none; color: var(--muted); font: 700 1.25rem/1 var(--display);
  padding: .3rem 0 .8rem; margin-bottom: -1.5px; border-bottom: 3px solid transparent; cursor: pointer;
}
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--marigold); }
.auth-form { display: grid; gap: .9rem; }
.field { display: grid; gap: .35rem; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span, .field legend { font-weight: 600; font-size: .92rem; padding: 0; margin-bottom: .35rem; }
.field input:not([type="radio"]) {
  font: inherit; color: var(--text); background: var(--bg); border: 0; border-radius: var(--r-md);
  padding: .75rem .9rem; box-shadow: inset 0 0 0 1.5px var(--line); width: 100%;
}
.field input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--marigold); }
.field input[aria-invalid="true"] { box-shadow: inset 0 0 0 2px var(--rose); }
.field small { font-size: .82rem; margin-top: .3rem; display: block; }
.segmented-sm span { padding: .55rem .4rem; font-size: .92rem; }
.auth-form .consent { margin: .2rem 0 0; }

.dialog-premium h2 { margin-right: 2.5rem; }
.plans { display: grid; gap: .6rem; margin: 1.1rem 0 1rem; }
.plan { position: relative; display: flex; align-items: center; gap: .8rem; padding: .95rem 1rem; border-radius: var(--r-md); cursor: pointer; box-shadow: inset 0 0 0 1.5px var(--line); }
.plan:has(input:checked) { box-shadow: inset 0 0 0 2.5px var(--marigold); background: var(--bg); }
.plan input { accent-color: var(--marigold); width: 1.15rem; height: 1.15rem; }
.plan-name { font-weight: 700; flex: 1; }
.plan-sub { display: block; font-weight: 500; font-size: .85rem; color: var(--muted); }
.plan-price { font: 700 1.25rem/1 var(--display); }
.plan-tag { position: absolute; top: -.6rem; right: 1rem; background: var(--rose); color: #fff; font: 700 .72rem/1 var(--body); padding: .3rem .55rem; border-radius: 999px; }
.premium-active { margin: .8rem 0 0; padding: .7rem .9rem; border-radius: var(--r-md); background: var(--surface-2); font-weight: 600; }
.pay-note { text-align: center; font-size: .82rem; margin: .7rem 0 0; }

@media (max-width: 700px) {
  .acct-name, .top-right > .online-pill { display: none; }
  .perks { flex-direction: column; align-items: flex-start; }
}

/* Camera & mic check on the home screen */
.media-check { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: 1rem 0 0; padding: .7rem .9rem; border-radius: var(--r-md); background: var(--bg); font-size: .92rem; color: var(--muted); }
.media-check p { margin: 0; flex: 1; min-width: 12rem; }
.media-dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--line); flex: none; }
.media-check[data-state="ready"] .media-dot { background: #3BC47A; box-shadow: 0 0 0 3px rgba(59,196,122,.22); }
.media-check[data-state="ready"] p { color: var(--text); }
.media-check[data-state="asking"] .media-dot { background: var(--marigold); animation: media-pulse 1.1s ease-in-out infinite; }
.media-check[data-state="asking"] p { color: var(--text); font-weight: 600; }
.media-check[data-state="blocked"] .media-dot { background: var(--rose); }
.media-check[data-state="blocked"] p { color: var(--text); }
@keyframes media-pulse { 50% { opacity: .3; } }
.hero-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); z-index: 1; background: #31285A; }
.frame-you.live .blob { display: none; }

/* ================= v3: Zogelo pages, footer, email flows ================= */
.top-links { display: flex; align-items: center; gap: 1.2rem; }
.top-links a:not(.btn) { color: var(--text); font-weight: 600; text-decoration: none; }
.top-links a:not(.btn):hover { color: var(--marigold-text); }

/* Content pages */
.page { display: flex; flex-direction: column; min-height: 100%; }
.doc { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 1rem clamp(1rem, 4vw, 2rem) 4rem; }
.doc h1 { font: 800 clamp(2rem, 5vw, 3rem)/1.05 var(--display); letter-spacing: -.03em; margin: 1.2rem 0 .8rem; text-wrap: balance; }
.doc h2 { font: 700 1.35rem/1.25 var(--display); letter-spacing: -.01em; margin: 2.2rem 0 .6rem; }
.doc p, .doc li { color: var(--muted); }
.doc li { margin-bottom: .45rem; }
.doc strong { color: var(--text); }
.doc .lede { font-size: 1.15rem; color: var(--text); opacity: .85; margin-bottom: 1.5rem; }
.doc-meta { font-size: .9rem; margin: 0 0 1rem; }
.steps { padding-left: 1.3rem; }
.small { font-size: .85rem; }
.mt { margin-top: .7rem; }
mark.todo { background: #FFE3A3; color: #5A3A00; padding: 0 .3em; border-radius: 4px; font-weight: 600; }

/* Forms on pages */
.form-card {
  background: var(--surface); border-radius: var(--r-lg); padding: clamp(1.2rem, 3vw, 1.8rem);
  box-shadow: inset 0 0 0 1px var(--line); margin-bottom: 1.2rem; display: grid; gap: .9rem;
}
.form-card h2 { margin: 0; }
.form-card form { display: grid; gap: .9rem; }
.form-card.narrow { max-width: 460px; }
.field select, .field textarea {
  font: inherit; color: var(--text); background: var(--bg); border: 0; border-radius: var(--r-md);
  padding: .75rem .9rem; box-shadow: inset 0 0 0 1.5px var(--line); width: 100%;
}
.field textarea { resize: vertical; min-height: 8rem; }
.field select:focus, .field textarea:focus { outline: none; box-shadow: inset 0 0 0 2px var(--marigold); }
.form-success { color: #1F7A4A; font-weight: 600; font-size: .93rem; margin: 0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .form-success { color: #6FD9A0; } }
:root[data-theme="dark"] .form-success { color: #6FD9A0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.side-card { background: var(--surface-2); border-radius: var(--r-lg); padding: 1.4rem; }
.side-card h2 { font-size: 1.1rem; margin: 1.2rem 0 .3rem; }
.side-card h2:first-child { margin-top: 0; }
.side-card p { margin: .3rem 0; overflow-wrap: anywhere; }
.doc:has(.two-col) { max-width: 1040px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1.2rem; margin: 0; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.row-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.pill { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.pill-ok { background: #D7F5E4; color: #13603A; }
.pill-warn { background: #FFE3A3; color: #5A3A00; }
.danger-zone { box-shadow: inset 0 0 0 1.5px var(--rose); }
.not-found { text-align: center; padding: 3rem 0; }
.big-num { font: 800 clamp(5rem, 18vw, 9rem)/1 var(--display); margin: 0; background: linear-gradient(90deg, var(--marigold), var(--rose)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.not-found .lede { margin: .5rem auto 2rem; max-width: 40ch; }

/* Main app additions */
a.acct-name { color: var(--text); text-decoration: none; }
a.acct-name:hover { text-decoration: underline; }
.link-btn.center { justify-self: center; font-weight: 600; font-size: .92rem; }
.verify-banner {
  display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin: .7rem 0 .3rem;
  padding: .8rem .95rem; border-radius: var(--r-md); background: #FFF1D1; color: #4A3000;
}
.verify-banner p { margin: 0; flex: 1; min-width: 14rem; font-size: .93rem; }
.verify-banner strong { color: #2A1A00; }
.verify-banner .btn-ghost { color: #4A3000; box-shadow: inset 0 0 0 2px #E2B355; }
.chat-disclaimer { margin: 0; padding: 0 .9rem .7rem; font-size: .76rem; color: var(--muted); line-height: 1.4; }
.chat-disclaimer a { color: var(--muted); }

/* Full footer with disclaimer */
.site-footer-full { border-top: 1px solid var(--line); padding: 2.2rem clamp(1rem, 4vw, 3rem) 1.5rem; background: var(--surface); }
.footer-inner { max-width: 1240px; margin: 0 auto; display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.footer-brand p { color: var(--muted); margin: .6rem 0 0; max-width: 30ch; }
.footer-nav { display: flex; gap: clamp(2rem, 6vw, 5rem); flex-wrap: wrap; }
.footer-nav h2 { font: 700 .8rem/1 var(--body); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 .8rem; }
.footer-nav a { display: block; color: var(--text); text-decoration: none; margin-bottom: .55rem; font-weight: 500; }
.footer-nav a:hover { color: var(--marigold-text); text-decoration: underline; }
.footer-disclaimer {
  max-width: 1240px; margin: 1.8rem auto 0; padding: 1rem 1.2rem; border-radius: var(--r-md);
  background: var(--bg); color: var(--muted); font-size: .86rem; line-height: 1.55;
}
.footer-disclaimer strong { color: var(--text); }
.footer-copy { max-width: 1240px; margin: 1rem auto 0; color: var(--muted); font-size: .85rem; }

@media (max-width: 800px) {
  .two-col { grid-template-columns: 1fr; }
  .top-links a:not(.btn) { display: none; }
}

/* Continue with Google + setup */
.google-wrap { display: grid; justify-items: center; gap: .6rem; margin: 0 0 1rem; }
.google-btn { min-height: 44px; display: flex; justify-content: center; }
.google-error { text-align: center; }
.or-divider { display: flex; align-items: center; gap: .8rem; width: 100%; margin: .3rem 0 0; color: var(--muted); font-size: .85rem; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.age-note { margin: -.3rem 0 0; font-size: .84rem; color: var(--muted); }
.setup-title { font: 700 1.5rem/1.15 var(--display); margin: 0 2.5rem .3rem 0; }
.setup-sub { margin: 0 0 1.1rem; font-size: .95rem; overflow-wrap: anywhere; }
.fake-google { display: inline-flex; align-items: center; gap: .6rem; padding: .7rem 1.4rem; border-radius: 999px; border: 1px solid #DADCE0; background: #fff; color: #1f1f1f; font: 500 .95rem/1 var(--body); cursor: pointer; }
.fake-google svg { width: 18px; height: 18px; }

/* ================= Profiles, friends, calls ================= */
.avatar { display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--surface-2); font-size: 1.15rem; line-height: 1; flex: none; }
.avatar-lg { width: 3rem; height: 3rem; font-size: 1.5rem; }
.avatar-xl { width: 4.5rem; height: 4.5rem; font-size: 2.2rem; }
.avatar-btn { border: 0; background: none; padding: 0; cursor: pointer; border-radius: 50%; }
.avatar-btn:hover .avatar { box-shadow: 0 0 0 3px var(--marigold); }
.icon-btn { position: relative; border: 0; background: var(--surface); color: var(--text); width: 2.4rem; height: 2.4rem; border-radius: 50%; display: grid; place-items: center; cursor: pointer; box-shadow: inset 0 0 0 1px var(--line); }
.icon-btn:hover { background: var(--surface-2); }
.badge { position: absolute; top: -4px; right: -4px; min-width: 1.15rem; height: 1.15rem; padding: 0 .3rem; border-radius: 999px; background: var(--rose); color: #fff; font: 700 .7rem/1.15rem var(--body); text-align: center; }
.hello-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.hello-row .link-btn { font-size: .9rem; }

/* Stranger card in chat */
.stranger-card { position: absolute; left: 1rem; top: 1rem; z-index: 2; display: flex; align-items: center; gap: .6rem; max-width: calc(100% - 2rem); background: rgba(255,255,255,.92); color: #1B1530; padding: .45rem .9rem .45rem .45rem; border-radius: 999px; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.stranger-card .s-text { min-width: 0; }
.stranger-card p { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-name { font-weight: 700; font-size: .95rem; }
.s-tags { font-size: .78rem; color: #5E557A; }
.s-tags b { color: #9A5F05; }
.chat.text-mode .stranger-card { display: none; }
.msg.intro-card { align-self: stretch; max-width: none; display: flex; gap: .8rem; align-items: flex-start; background: var(--bg); border-radius: var(--r-md); padding: .8rem; text-align: left; }
.intro-card p { margin: .15rem 0 0; }
.tag { display: inline-block; font-size: .8rem; font-weight: 600; color: var(--muted); background: var(--surface-2); padding: .1rem .5rem; border-radius: 999px; margin: .25rem .25rem 0 0; }
.tag.common { background: #FFE3A3; color: #5A3A00; }
.msg.friend-req { align-self: stretch; max-width: none; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; background: #FFF1D1; color: #4A3000; border-radius: var(--r-md); }
.msg.friend-req span.txt { flex: 1; min-width: 10rem; }
.msg.friend-req .btn { padding: .45em .9em; font-size: .85rem; }
.ctrl[data-state="requested"] { color: var(--muted); }
.ctrl[data-state="friends"] { color: #1F7A4A; }
.btn-on-dark { color: #F7F1E6; box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); }

/* Edit profile */
.avatar-picker { display: flex; gap: 1rem; align-items: center; }
.avatar-options { display: grid; gap: .5rem; min-width: 0; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: .25rem; }
.emoji-grid button, .color-row button { border: 0; cursor: pointer; border-radius: 10px; }
.emoji-grid button { background: var(--bg); font-size: 1.1rem; padding: .3rem 0; }
.emoji-grid button[aria-checked="true"] { box-shadow: inset 0 0 0 2px var(--marigold); background: var(--surface-2); }
.color-row { display: flex; gap: .35rem; flex-wrap: wrap; }
.color-row button { width: 1.6rem; height: 1.6rem; border-radius: 50%; }
.color-row button[aria-checked="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }
.counter { float: right; font-weight: 500; color: var(--muted); }
.lang-grid { display: flex; flex-wrap: wrap; gap: .35rem; }
.lang-grid label { cursor: pointer; }
.lang-grid input { position: absolute; opacity: 0; }
.lang-grid span { display: inline-block; padding: .35rem .7rem; border-radius: 999px; font-size: .85rem; font-weight: 600; background: var(--bg); color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--line); }
.lang-grid input:checked + span { background: var(--marigold); color: var(--marigold-ink); box-shadow: none; }
.lang-grid input:focus-visible + span { outline: 3px solid var(--marigold); outline-offset: 1px; }

/* Friends dialog */
.dialog-friends { width: min(520px, calc(100% - 1.5rem)); max-height: calc(100dvh - 2rem); overflow-y: auto; }
.dialog-friends .tabs { margin-right: 2.5rem; }
.dialog-friends .tabs button { font-size: 1.05rem; }
.people { display: grid; gap: .5rem; }
.person { display: flex; align-items: center; gap: .75rem; padding: .7rem; border-radius: var(--r-md); background: var(--bg); }
.person .avatar { position: relative; }
.person .avatar.online::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: .7rem; height: .7rem; border-radius: 50%; background: #3BC47A; box-shadow: 0 0 0 2px var(--bg); }
.person-text { flex: 1; min-width: 0; }
.person-text p { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-name { font-weight: 700; }
.person-sub { font-size: .82rem; color: var(--muted); }
.person-actions { display: flex; gap: .35rem; flex: none; }
.person-actions .btn { padding: .45em .85em; font-size: .85rem; }
.people-empty { color: var(--muted); text-align: center; padding: 1.5rem .5rem; margin: 0; }
.section-label { font: 700 .78rem/1 var(--body); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: .8rem 0 .2rem; }

/* Incoming call */
.dialog-call { text-align: center; width: min(360px, calc(100% - 2rem)); }
.dialog-call h2 { margin: .8rem 0 0; }
.dialog-call p { margin: .2rem 0 1.4rem; }
.call-actions { display: flex; gap: .7rem; justify-content: center; }
.ringing { animation: ring 1.2s ease-in-out infinite; }
@keyframes ring { 0%, 100% { box-shadow: 0 0 0 0 rgba(242,169,59,.6); } 50% { box-shadow: 0 0 0 16px rgba(242,169,59,0); } }

@media (max-width: 700px) {
  .emoji-grid { grid-template-columns: repeat(6, 1fr); }
  .avatar-picker { align-items: flex-start; }
  .person-actions .btn-ghost { display: none; }
}
.field .chips-input input { box-shadow: none; background: transparent; border-radius: 0; padding: .35rem .2rem; width: auto; flex: 1; min-width: 8rem; }
.field .chips-input input:focus { box-shadow: none; }
.field > span small { display: inline; font-weight: 400; margin: 0; }

/* ================= Homepage sections ================= */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.home-nav { display: flex; gap: 1.4rem; margin-right: auto; margin-left: 2.2rem; }
.home-nav a { color: var(--text); text-decoration: none; font-weight: 600; font-size: .95rem; opacity: .8; }
.home-nav a:hover { opacity: 1; color: var(--marigold-text); }
.home-section, .home-intro, .final-cta { max-width: 1240px; width: 100%; margin: 0 auto; padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1rem, 4vw, 3rem); scroll-margin-top: 1rem; }
.home-section > h2, .home-intro h2, .final-cta h2 { font: 800 clamp(1.9rem, 4vw, 2.9rem)/1.05 var(--display); letter-spacing: -.03em; margin: 0 0 1.6rem; text-wrap: balance; }
.home-intro { text-align: center; padding-top: clamp(1.5rem, 4vw, 3rem); }
.home-intro h2 { margin-bottom: 1rem; }
.home-intro p:not(.eyebrow) { max-width: 62ch; margin: 0 auto; color: var(--muted); font-size: 1.1rem; }
.eyebrow { font: 700 .82rem/1 var(--body); text-transform: uppercase; letter-spacing: .1em; color: var(--marigold-text); margin: 0 0 .8rem; }
h3 { font: 700 1.15rem/1.25 var(--display); margin: 0 0 .4rem; }

/* How it works */
.how-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; counter-reset: none; }
.how-steps li { background: var(--surface); border-radius: var(--r-lg); padding: 1.4rem; box-shadow: inset 0 0 0 1px var(--line); position: relative; }
.how-steps p { margin: 0; color: var(--muted); }
.step-num { display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--marigold); color: var(--marigold-ink); font: 800 1.05rem/1 var(--display); margin-bottom: .9rem; }

/* Features */
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.feature { background: var(--surface); border-radius: var(--r-lg); padding: 1.5rem; box-shadow: inset 0 0 0 1px var(--line); }
.feature p { margin: 0; color: var(--muted); }
.f-icon { display: inline-grid; place-items: center; width: 2.8rem; height: 2.8rem; border-radius: 14px; margin-bottom: 1rem; }
.f-icon svg { width: 1.4rem; height: 1.4rem; }
.f-amber { background: #FFE9C2; color: #8A5300; }
.f-rose { background: #FBD9E3; color: #A82850; }
.f-violet { background: #E4DCFF; color: #4A33B5; }
.f-teal { background: #D2F0E8; color: #1D6A5B; }
.f-blue { background: #DAE5FF; color: #2A4FA6; }
.f-light { background: rgba(255,255,255,.14); color: #F2A93B; }

/* Safety band */
.safety-band { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center;
  background: #1B1530; color: #F7F1E6; border-radius: 32px; width: calc(100% - 2 * clamp(1rem, 4vw, 3rem)); }
.safety-band h2 { color: #F7F1E6; margin-bottom: .8rem; }
.safety-copy > p { color: #B3A9CF; margin: 0 0 1.2rem; }
.safety-list { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: .8rem; }
.safety-list li { padding-left: 1.6rem; position: relative; color: #CFC6E6; }
.safety-list li::before { content: "✓"; position: absolute; left: 0; color: #F2A93B; font-weight: 800; }
.safety-list strong { color: #F7F1E6; }
.compare-wrap { overflow-x: auto; }
.compare { width: 100%; border-collapse: separate; border-spacing: 0; background: #251D41; border-radius: 20px; overflow: hidden; font-size: .95rem; }
.compare caption { caption-side: bottom; text-align: left; color: #8F86AB; font-size: .8rem; padding-top: .6rem; }
.compare th, .compare td { padding: .8rem 1rem; text-align: center; border-bottom: 1px solid #3D3366; }
.compare tbody tr:last-child th, .compare tbody tr:last-child td { border-bottom: 0; }
.compare thead th { font: 700 .95rem/1.2 var(--display); color: #F7F1E6; background: #31285A; }
.compare thead th:nth-child(2) { color: #F2A93B; }
.compare tbody th { text-align: left; font-weight: 500; color: #CFC6E6; }
.compare td:nth-child(2) { background: rgba(242,169,59,.07); }
.yes { color: #6FD9A0; font-weight: 800; font-size: 1.1rem; }
.no { color: #EE6A8F; font-weight: 800; font-size: 1.1rem; }
.part { color: #B3A9CF; font-size: .85rem; }

/* FAQ */
.faq { display: grid; gap: .6rem; max-width: 860px; }
.faq details { background: var(--surface); border-radius: var(--r-md); box-shadow: inset 0 0 0 1px var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 1.05rem 3rem 1.05rem 1.2rem; font-weight: 700; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 1.2rem; top: 50%; transform: translateY(-50%); font: 600 1.4rem/1 var(--body); color: var(--marigold-text); transition: transform .2s ease; }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { margin: 0; padding: 0 1.2rem 1.1rem; color: var(--muted); }

/* Final CTA */
.final-cta { text-align: center; padding-bottom: clamp(3rem, 7vw, 5rem); }
.final-cta h2 { margin-bottom: .6rem; }
.final-cta p { color: var(--muted); margin: 0 0 1.5rem; font-size: 1.05rem; }
.final-cta .online-count { font-weight: 700; color: var(--text); }
.perks { margin-top: 1rem; }

@media (max-width: 1000px) {
  .how-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .safety-band { grid-template-columns: 1fr; }
  .home-nav { display: none; }
}
@media (max-width: 600px) {
  .how-steps, .feature-grid { grid-template-columns: 1fr; }
  .safety-band { border-radius: 24px; }
  .compare th, .compare td { padding: .65rem .6rem; font-size: .88rem; }
}
.safety-band h2 { font: 800 clamp(1.9rem, 4vw, 2.9rem)/1.05 var(--display); letter-spacing: -.03em; text-wrap: balance; }
.safety-band + .perks { margin-top: 1.8rem; }
.final-cta .cta-sub { margin-top: 0; }
.final-cta #ctaOnline + .cta-sub { margin-top: -1rem; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .safety-band { background: #2A2150; box-shadow: inset 0 0 0 1px #3D3366; }
  :root:not([data-theme="light"]) .compare { background: #1F1838; }
}
:root[data-theme="dark"] .safety-band { background: #2A2150; box-shadow: inset 0 0 0 1px #3D3366; }
:root[data-theme="dark"] .compare { background: #1F1838; }

/* ================= Hero: animated video-chat demo ================= */
.hero-demo { position: relative; width: 100%; max-width: 620px; justify-self: center; padding: 1.4rem 0 0; outline: none; }
.demo-frame {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  aspect-ratio: 16 / 10.5; padding: 7px; border-radius: 26px;
  background: linear-gradient(135deg, #F2A93B, #E8577E 50%, #6B4FD8);
  box-shadow: 0 30px 70px -28px rgba(107,79,216,.65), 0 0 0 1px rgba(255,255,255,.4) inset;
  animation: frame-in .9s cubic-bezier(.2,.8,.2,1) both;
}
.demo-pane { position: relative; overflow: hidden; background: #31285A; }
.demo-pane:first-child { border-radius: 20px 6px 6px 20px; }
.demo-pane:nth-child(2) { border-radius: 6px 20px 20px 6px; }
.pane-art, .pane-art svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* People: gentle sway, blinking, talking */
.pane-art .sway { transform-origin: 150px 340px; animation: sway 6s ease-in-out infinite; }
#demoThem .pane-art .sway { animation-duration: 5.2s; animation-delay: -1.5s; }
.pane-art .head { transform-origin: 150px 190px; animation: nod 4.4s ease-in-out infinite; }
.pane-art .eyes { transform-box: fill-box; transform-origin: center; animation: blink 4.2s infinite; }
#demoThem .pane-art .eyes { animation-delay: -2.1s; }
.pane-art .mouth { transform-box: fill-box; transform-origin: center; transform: scaleY(.55); }
.talking .pane-art .mouth { animation: talk .22s ease-in-out infinite alternate; }
@keyframes sway { 0%, 100% { transform: rotate(-1.4deg); } 50% { transform: rotate(1.4deg); } }
@keyframes nod { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(2.5deg) translateY(1px); } 65% { transform: rotate(-2deg); } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes talk { from { transform: scaleY(.5); } to { transform: scaleY(1.7); } }

/* Stranger slides in and out like pressing Next */
#demoThem .pane-art, #demoThem .pane-chip { transition: transform .5s cubic-bezier(.6,0,.3,1), opacity .4s ease; }
#demoThem.entering .pane-art, #demoThem.entering .pane-chip { transform: translateX(105%); opacity: 0; transition: none; }
#demoThem.leaving .pane-art, #demoThem.leaving .pane-chip { transform: translateX(-105%); opacity: 0; }

/* Name chips and chat bubbles */
.pane-chip {
  position: absolute; left: .55rem; top: .55rem; z-index: 2; display: flex; align-items: center; gap: .4rem;
  max-width: calc(100% - 1.1rem); padding: .25rem .65rem .25rem .25rem; border-radius: 999px;
  background: rgba(255,255,255,.93); color: #1B1530; box-shadow: 0 4px 14px rgba(0,0,0,.18);
}
.pane-chip:empty { display: none; }
.chip-av { display: grid; place-items: center; width: 1.65rem; height: 1.65rem; border-radius: 50%; font-size: .85rem; flex: none; }
.chip-text { display: grid; line-height: 1.15; min-width: 0; }
.chip-text b { font-size: .8rem; }
.chip-text small { font-size: .66rem; color: #5E557A; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-text mark { background: #FFE3A3; color: #5A3A00; border-radius: 4px; padding: 0 .2em; }
.pane-chat { position: absolute; left: .5rem; right: .5rem; bottom: 2.9rem; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; }
#demoYou .pane-chat { align-items: flex-end; }
.demo-bubble {
  margin: 0; max-width: 92%; padding: .4rem .65rem; border-radius: 14px 14px 14px 4px;
  background: #fff; color: #1B1530; font-size: .74rem; font-weight: 600; line-height: 1.3;
  box-shadow: 0 6px 16px rgba(0,0,0,.2); animation: pop .35s cubic-bezier(.3,1.5,.5,1) both;
}
#demoYou .demo-bubble { background: #F2A93B; color: #2A1A00; border-radius: 14px 14px 4px 14px; }
@keyframes pop { from { transform: scale(.4) translateY(8px); opacity: 0; } }

/* Finding someone / friend toast */
.demo-finding { position: absolute; inset: 0; z-index: 3; display: grid; place-content: center; justify-items: center; gap: .3rem; background: #1B1530; color: #F7F1E6; text-align: center; }
.demo-finding p { margin: 0; font: 600 .82rem/1.2 var(--body); }
.demo-finding .orbit { transform: scale(.7); }
.demo-toast {
  position: absolute; left: 50%; bottom: 3.6rem; z-index: 6; transform: translateX(-50%); margin: 0; white-space: nowrap;
  padding: .5rem .85rem; border-radius: 999px; background: #fff; color: #1B1530; font: 700 .76rem/1 var(--body);
  box-shadow: 0 10px 26px rgba(0,0,0,.3); animation: pop .4s cubic-bezier(.3,1.5,.5,1) both;
}

/* Control bar */
.demo-controls { position: absolute; left: 0; right: 0; bottom: .9rem; z-index: 5; display: flex; justify-content: center; gap: .4rem; pointer-events: none; }
.demo-ctrl { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: rgba(27,21,48,.6); backdrop-filter: blur(6px); font-size: .8rem; color: #fff; }
.demo-next { display: grid; place-items: center; padding: 0 1rem; height: 2rem; border-radius: 999px; background: #F2A93B; color: #2A1A00; font: 800 .8rem/1 var(--body); box-shadow: 0 4px 0 -1px #C27C12; transition: transform .15s ease; }
.demo-next.pressed { transform: scale(.88); box-shadow: 0 1px 0 -1px #C27C12; }

/* Page dots */
.demo-dots { display: flex; justify-content: center; gap: .45rem; margin-top: 1rem; }
.demo-dots button { width: .6rem; height: .6rem; border-radius: 999px; border: 0; padding: 0; background: var(--line); cursor: pointer; transition: width .3s ease, background-color .3s ease; }
.demo-dots button[aria-current="true"] { width: 1.6rem; background: var(--marigold); }

/* Floating decorations around the frame */
.floaty { position: absolute; z-index: 1; display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 16px; background: var(--surface); box-shadow: 0 12px 28px -10px rgba(27,21,48,.35); font-size: 1.4rem; animation: floaty 7s ease-in-out infinite; }
.demo-frame { z-index: 2; }
.f1 { left: -1.2rem; top: 18%; animation-delay: -1s; }
.f2 { right: -1.3rem; top: 4%; animation-delay: -3s; transform: rotate(8deg); }
.f3 { right: -1.6rem; bottom: 20%; animation-delay: -5s; }
.f4 { left: -1.6rem; bottom: 10%; animation-delay: -2s; width: 2.6rem; height: 2.6rem; font-size: 1.2rem; }
.f5 { left: 46%; top: -.4rem; animation-delay: -4s; width: 2.3rem; height: 2.3rem; font-size: 1rem; }
@keyframes floaty { 0%, 100% { translate: 0 0; rotate: -4deg; } 50% { translate: 0 -14px; rotate: 5deg; } }
@keyframes frame-in { from { opacity: 0; transform: translateY(24px) scale(.97); } }

@media (max-width: 900px) {
  .hero-demo { max-width: 560px; order: -1; padding-top: .6rem; }
  .floaty { display: none; }
}
@media (max-width: 480px) {
  .demo-frame { aspect-ratio: 4 / 3.4; border-radius: 20px; padding: 5px; }
  .demo-bubble { font-size: .66rem; padding: .32rem .5rem; }
  .chip-text small { display: none; }
  .demo-ctrl { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .pane-art .sway, .pane-art .head, .pane-art .eyes, .floaty, .demo-frame { animation: none !important; }
}
/* Your real camera inside the demo's "You" pane once allowed */
#demoYou .hero-preview { z-index: 1; border-radius: inherit; }
#demoYou.live .pane-chat { display: none; }

/* ================= Chat: full-screen video on phones ================= */
.ctrl-rail { display: contents; }            /* desktop: buttons sit in the normal row */

@media (max-width: 700px), (max-height: 500px) and (pointer: coarse) {
  body.chat-open { overflow: hidden; overscroll-behavior: none; }
  .chat:not(.text-mode) {
    --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
    --dock: calc(var(--safe-bottom) + 5.9rem);          /* height of the message box + disclaimer */
    position: fixed; inset: 0; z-index: 30; display: block; height: 100dvh; background: #000;
  }

  /* Video fills the screen */
  .chat:not(.text-mode) .stage { position: absolute; inset: 0; padding: 0; display: block; }
  .chat:not(.text-mode) .remote-wrap { position: absolute; inset: 0; border-radius: 0; }
  .chat:not(.text-mode) #remoteVideo, .chat:not(.text-mode) .fake-remote { object-fit: cover; }
  .chat:not(.text-mode) .remote-overlay { padding-bottom: calc(var(--dock) + 4rem); }

  /* Top bar floats over the video */
  .chat:not(.text-mode) .chat-top {
    position: absolute; top: 0; left: 0; right: 0; z-index: 6;
    padding: calc(var(--safe-top) + .55rem) .9rem 1.6rem;
    background: linear-gradient(rgba(0,0,0,.6), transparent);
  }
  .chat:not(.text-mode) .chat-top .brand { color: #fff; }
  .chat:not(.text-mode) .status-line { color: rgba(255,255,255,.88); text-align: right; font-size: .82rem; }

  /* Stranger's name card and your own camera */
  .chat:not(.text-mode) .stranger-card { top: calc(var(--safe-top) + 3.3rem); left: .7rem; max-width: calc(100% - 9.5rem); }
  .chat:not(.text-mode) .local-wrap {
    top: calc(var(--safe-top) + 3.3rem); right: .7rem; bottom: auto;
    width: 27vw; max-width: 120px; aspect-ratio: 3 / 4; border-radius: 14px; z-index: 4;
    box-shadow: 0 0 0 2px rgba(255,255,255,.35), 0 10px 24px rgba(0,0,0,.45);
  }

  /* Floating buttons: column on the right, Meet + Next above the message box */
  .chat:not(.text-mode) .controls { position: absolute; left: .7rem; right: .7rem; bottom: calc(var(--dock) + .2rem); z-index: 6; display: flex; flex-wrap: nowrap; gap: .5rem; align-items: center; }
  .chat:not(.text-mode) .ctrl-rail {
    position: absolute; right: 0; bottom: calc(100% + .7rem);
    display: flex; flex-direction: column; gap: .5rem;
  }
  .chat:not(.text-mode) .ctrl {
    width: 2.75rem; height: 2.75rem; min-width: 0; padding: 0; justify-content: center; border-radius: 50%;
    background: rgba(18,14,34,.55); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  }
  .chat:not(.text-mode) .ctrl svg { width: 1.3rem; height: 1.3rem; }
  .chat:not(.text-mode) .ctrl-label { display: none; }
  .chat:not(.text-mode) .ctrl:disabled { opacity: .45; }
  .chat:not(.text-mode) .ctrl-danger { color: #FF8FAE; }
  .chat:not(.text-mode) .ctrl[aria-pressed="true"] { background: rgba(217,64,107,.85); color: #fff; }
  .chat:not(.text-mode) .ctrl[data-state="friends"] { color: #7FE3AE; }
  .chat:not(.text-mode) .ctrl-select { width: auto; border-radius: 999px; padding: 0 .9rem; flex-direction: row; }
  .chat:not(.text-mode) .ctrl-select select { color: #fff; font-size: .9rem; max-width: 7rem; }
  .chat:not(.text-mode) .btn-next { margin-left: auto; height: 2.9rem; padding-inline: 2rem; font-size: 1.05rem; }
  .chat:not(.text-mode) .btn-next kbd { display: none; }

  /* Messages float over the bottom of the video */
  .chat:not(.text-mode) .chatbox {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; margin: 0; border-radius: 0;
    background: linear-gradient(transparent, rgba(0,0,0,.45) 20%, rgba(0,0,0,.75));
    box-shadow: none; padding-bottom: var(--safe-bottom); pointer-events: none; overflow: visible;
  }
  .chat:not(.text-mode) .chatbox > * { pointer-events: auto; }
  .chat:not(.text-mode) .messages {
    flex: none; max-height: min(30vh, 15rem); padding: 1.5rem 4rem 0 .8rem; margin-bottom: 3.9rem; gap: .35rem;
    -webkit-mask-image: linear-gradient(transparent, #000 1.6rem); mask-image: linear-gradient(transparent, #000 1.6rem);
  }
  .chat:not(.text-mode) .msg { font-size: .92rem; padding: .45rem .75rem; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
  .chat:not(.text-mode) .msg.them { background: rgba(255,255,255,.94); color: #1B1530; }
  .chat:not(.text-mode) .msg.system { color: rgba(255,255,255,.9); text-shadow: 0 1px 4px rgba(0,0,0,.6); box-shadow: none; }
  .chat:not(.text-mode) .msg.system strong { color: #fff; }
  .chat:not(.text-mode) .msg.intro-card { background: rgba(18,14,34,.6); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); text-shadow: none; }
  .chat:not(.text-mode) .msg.intro-card p { color: rgba(255,255,255,.85); }
  .chat:not(.text-mode) .msg.intro-card .tag { background: rgba(255,255,255,.16); color: #fff; }
  .chat:not(.text-mode) .msg.intro-card .tag.common { background: #FFE3A3; color: #5A3A00; }
  .chat:not(.text-mode) .typing { color: rgba(255,255,255,.8); position: absolute; left: .9rem; bottom: calc(var(--dock) + 3.6rem); padding: 0; margin: 0; }
  .chat:not(.text-mode) .msg-form { border-top: 0; padding: .45rem .7rem; }
  .chat:not(.text-mode) .msg-form input { background: rgba(255,255,255,.95); color: #1B1530; box-shadow: none; }
  .chat:not(.text-mode) .chat-disclaimer { color: rgba(255,255,255,.62); font-size: .66rem; padding: 0 .9rem .45rem; }
  .chat:not(.text-mode) .chat-disclaimer a { color: rgba(255,255,255,.75); }

  /* Tap the video to hide everything except the video */
  .chat .chat-top, .chat .controls, .chat .chatbox, .chat .stranger-card { transition: opacity .25s ease; }
  .chat.ui-hidden:not(.text-mode) .chat-top, .chat.ui-hidden:not(.text-mode) .controls,
  .chat.ui-hidden:not(.text-mode) .chatbox, .chat.ui-hidden:not(.text-mode) .stranger-card { opacity: 0; pointer-events: none; }
  .chat.ui-hidden:not(.text-mode) .chatbox > * { pointer-events: none; }

  /* Text-only chat on phones: full height, simple */
  .chat.text-mode { height: 100dvh; }
}
@media (max-width: 380px) {
  .chat:not(.text-mode) .ctrl { width: 2.5rem; height: 2.5rem; }
  .chat:not(.text-mode) .btn-next { padding-inline: 1.4rem; }
}
/* Short phones: shrink the right-hand column so it never meets your camera window */
@media (max-height: 680px) and (max-width: 700px) {
  .chat:not(.text-mode) .ctrl-rail { gap: .35rem; }
  .chat:not(.text-mode) .ctrl { width: 2.35rem; height: 2.35rem; }
  .chat:not(.text-mode) .local-wrap { max-width: 96px; }
  .chat:not(.text-mode) .messages { max-height: 22vh; }
}
@media (max-width: 700px), (max-height: 500px) and (pointer: coarse) {
  .chat:not(.text-mode) .controls .ctrl.ctrl-select { width: auto; min-width: 7.2rem; padding: 0 .9rem; }
}

/* Delivered / Seen under your latest message */
.msg-status { align-self: flex-end; list-style: none; margin: -.15rem .3rem .1rem 0; font-size: .72rem; font-weight: 600; color: var(--muted); }
.msg-status:empty { display: none; }
.msg-status.seen { color: var(--marigold-text); }
@media (max-width: 700px), (max-height: 500px) and (pointer: coarse) {
  .chat:not(.text-mode) .msg-status { color: rgba(255,255,255,.8); text-shadow: 0 1px 4px rgba(0,0,0,.6); }
  .chat:not(.text-mode) .msg-status.seen { color: #FFD38A; }
}
.footer-copy { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem 1.5rem; }
.footer-maker a { color: var(--text); font-weight: 700; text-decoration: none; }
.footer-maker a:hover { color: var(--marigold-text); text-decoration: underline; }
