/* AnonymChat v4 — faithful to the original SecretChat look: white page, black
   Montserrat wordmark, flat lavender circle + pill, light-grey outline rings.
   Fonts are self-hosted Latin subsets (SIL OFL), no third-party requests. */

@font-face {
  font-family: "Montserrat";
  src: url("/fonts/montserrat-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --lav: #907aff;        /* sampled from the original screenshot */
  --lav-deep: #6d55ee;   /* lavender for small white text (AA contrast) */
  --lav-soft: #efebff;
  --ring: #dadada;       /* sampled */
  --ink: #000000;
  --text: #111111;
  --muted: #737373;
  --them: #f1f1f3;
  --line: #ececef;
  --bg: #ffffff;
  --ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --brand: "Montserrat", var(--ui);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.45 var(--ui);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--lav); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- landing ---------- */
.landing, .notice {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px 64px;
  text-align: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 45px;
  font-weight: 400;
}
.logo-words { display: flex; flex-direction: column; align-items: flex-start; padding-top: 12px; }
.logo-name {
  font: 700 35px/1 var(--brand);
  letter-spacing: -0.005em;
  color: var(--ink);
}
.logo-sub {
  margin-top: 5px;
  font: 700 9.6px/1 var(--brand);
  color: var(--ink);
  letter-spacing: 0.005em;
}
.logo-circle {
  display: grid;
  place-items: center;
  width: 115px;
  height: 115px;
  border-radius: 50%;
  background: var(--lav);
  color: #fff;
  font: 700 36px/1 var(--ui);
  letter-spacing: -0.01em;
}

.cta {
  display: inline-grid;
  place-items: center;
  width: 330px;
  max-width: 100%;
  height: 78px;
  padding: 12px 24px;
  border: 0;
  border-radius: 999px;
  background: var(--lav);
  color: #fff;
  font: 700 36px/1 var(--ui);
  letter-spacing: -0.015em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease, transform 150ms ease;
}
.cta:hover { background: #8169fb; }
.cta:active { transform: scale(0.98); }
.cta-small { width: auto; height: 56px; padding: 12px 32px; font-size: 20px; margin-top: 28px; background: var(--lav-deep); }
.cta-small:hover { background: #5d45e0; }

.features {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 50px 0 0;
  padding: 0;
  list-style: none;
}
.features li { display: flex; flex-direction: column; align-items: center; width: 100px; }
.ring {
  display: grid;
  place-items: center;
  width: 100px;
  height: 100px;
  border: 4px solid var(--ring);
  border-radius: 50%;
  color: #c9c9c9;
}
.vpn { font: 700 22px/1 var(--ui); letter-spacing: 0.01em; color: #cdcdcd; }
.cap {
  margin-top: 14px;
  font: 400 12px/1.5 var(--ui);
  color: var(--muted);
}

.badge {
  position: fixed;
  right: 10px;
  bottom: 10px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #7b63f6;
  color: #fff;
  font: 700 11.5px/1.2 var(--ui);
}

/* ---------- notice ---------- */
.notice-title { margin: 0 0 10px; font: 700 28px/1.2 var(--brand); color: var(--ink); }
.notice-text { margin: 0; max-width: 42ch; color: var(--muted); }

/* ---------- chat ---------- */
.chat {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  grid-template-columns: minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  max-width: 760px;
  margin: 0 auto;
}

.bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.mini-logo { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.mini-name { font: 700 19px/1 var(--brand); color: var(--ink); }
.mini-circle {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--lav);
  color: #fff;
  font: 700 13px/1 var(--ui);
}
.presence {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 auto 0 8px;
  font-size: 14px;
  color: var(--muted);
  min-width: 0;
}
.pdot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ring); }
.pdot[data-state="on"] { background: #22a861; }
.pdot[data-state="wait"] { background: var(--lav); }
.leave {
  flex: none;
  min-height: 40px;
  padding: 8px 16px;
  border: 2px solid var(--ring);
  border-radius: 999px;
  background: var(--bg);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease;
}
.leave:hover { border-color: #e04848; color: #c42f2f; }

.invite {
  margin: 14px 16px 0;
  padding: 16px;
  border-radius: 20px;
  background: var(--lav-soft);
}
.invite-title { margin: 0 0 10px; font-weight: 700; color: var(--ink); }
.invite-row { display: flex; gap: 8px; min-width: 0; }
.invite-url {
  flex: 1;
  min-width: 0;
  padding: 11px 16px;
  border-radius: 999px;
  background: var(--bg);
  font-size: 14px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: all;
}
.pill {
  flex: none;
  min-height: 44px;
  padding: 10px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--lav-deep);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 150ms ease;
}
.pill:hover { background: #5d45e0; }
.invite-note { margin: 10px 0 0; max-width: 56ch; font-size: 13px; color: #55506b; }
.invite.compact .invite-title,
.invite.compact .invite-note { display: none; }
.invite.compact { padding: 10px; background: #f6f4ff; }

.feed {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px;
}
.sys {
  margin: 0 auto 14px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
}
.msgs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 78%; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.bubble {
  margin: 0;
  padding: 10px 14px;
  border-radius: 20px 20px 20px 6px;
  max-width: 68ch;
  background: var(--them);
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.msg.mine .bubble {
  border-radius: 20px 20px 6px 20px;
  background: var(--lav-deep);
  color: #fff;
}
.meta { margin: 4px 6px 0; font-size: 11.5px; color: var(--muted); }
.sysline { align-self: center; font-size: 12.5px; color: var(--muted); }

.composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.composer textarea {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  max-height: 140px;
  padding: 12px 18px;
  border: 2px solid var(--ring);
  border-radius: 24px;
  background: var(--bg);
  resize: none;
  font-size: 16px; /* no iOS zoom on focus */
  line-height: 1.35;
}
.composer textarea:focus { outline: none; border-color: var(--lav); }
.composer.over textarea { border-color: #e04848; }
.send {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: var(--lav-deep);
  color: #fff;
  cursor: pointer;
  transition: background-color 150ms ease;
}
.send:hover { background: #5d45e0; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 32px);
  margin: 0;
  padding: 10px 16px;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: 14px;
  z-index: 10;
}

/* ---------- small screens ---------- */
@media (max-width: 420px) {
  .logo { gap: 10px; margin-bottom: 36px; }
  .logo-name { font-size: 31px; }
  .logo-sub { font-size: 8.5px; }
  .logo-circle { width: 98px; height: 98px; font-size: 31px; }
  .cta { width: 300px; height: 72px; font-size: 32px; }
  .cta-small { width: auto; height: 56px; font-size: 20px; }
  .features { gap: 8px; margin-top: 42px; }
  .features li { width: 96px; }
  .ring { width: 92px; height: 92px; }
  .presence { margin-left: 2px; font-size: 13px; }
  .mini-name { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
