/* TwoStrangers - landing page and chat. */

:root {
  --bg: #0a0b0d;
  --bg-soft: #101216;
  --surface: #14161b;
  --surface-2: #1b1e24;
  --line: #262a32;
  --line-soft: #1e222a;
  --text: #edeff2;
  --muted: #98a0ab;
  --muted-2: #6d7581;
  --accent: #7cf5c4;
  --accent-ink: #04170f;
  --danger: #ff7a7a;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.8);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100dvh; line-height: 1.55; }

a { color: inherit; }
p { margin: 0; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; }

::selection { background: rgba(124, 245, 196, 0.28); }

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 550;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.08s ease,
    opacity 0.15s ease;
  white-space: nowrap;
}

.btn:hover { background: var(--surface-2); border-color: #333944; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 650;
}
.btn-primary:hover { background: #96ffd2; border-color: #96ffd2; }

.btn-lg { padding: 14px 30px; font-size: 15px; }

.btn-danger { color: var(--danger); border-color: rgba(255, 122, 122, 0.28); }
.btn-danger:hover { background: rgba(255, 122, 122, 0.1); border-color: rgba(255, 122, 122, 0.5); }

/* ------------------------------------------------------------ landing page */

.wrap { max-width: 680px; margin: 0 auto; padding: 0 22px; }

.hero {
  position: relative;
  padding: 96px 0 72px;
  text-align: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -160px 0 auto;
  height: 420px;
  background: radial-gradient(50% 60% at 50% 40%, rgba(124, 245, 196, 0.14), transparent 70%);
  pointer-events: none;
}

.hero > * { position: relative; }

.hero h1 { font-size: clamp(34px, 7.6vw, 56px); font-weight: 700; }

.hero h1 .grad {
  background: linear-gradient(100deg, var(--accent), #b6c6ff 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  max-width: 420px;
  margin: 20px auto 0;
  font-size: 16px;
  color: var(--muted);
}

.hero .btn { margin-top: 32px; }

.block { padding: 40px 0; border-top: 1px solid var(--line-soft); }

.block h2 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted-2);
  margin-bottom: 22px;
}

.steps {
  counter-reset: step;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 20px;
}

.steps li {
  display: grid;
  grid-template-columns: 26px 1fr;
  column-gap: 14px;
  row-gap: 2px;
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  grid-row: span 2;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(124, 245, 196, 0.12);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
}

.steps b { color: var(--text); font-size: 15px; font-weight: 600; }
.steps span { color: var(--muted); font-size: 14.5px; }

.rules-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  font-size: 15px;
  color: var(--muted);
}

.rules-list li { position: relative; padding-left: 18px; }

.rules-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

details.faq { border-top: 1px solid var(--line-soft); padding: 16px 0; }
details.faq:first-of-type { border-top: none; padding-top: 0; }

details.faq summary {
  cursor: pointer;
  font-weight: 550;
  font-size: 15px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; color: var(--muted-2); font-size: 18px; }
details.faq[open] summary::after { content: "–"; }

details.faq p { color: var(--muted); font-size: 14.5px; margin-top: 10px; }

footer.site { border-top: 1px solid var(--line-soft); padding: 22px; }

.foot {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  color: var(--muted-2);
  font-size: 12.5px;
}

.stamp { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------- modal */

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 6, 8, 0.72);
  backdrop-filter: blur(6px);
}

.modal.open { display: flex; }

.modal-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow);
  animation: pop 0.18s ease-out;
}

@keyframes pop {
  from { opacity: 0; transform: translateY(8px) scale(0.99); }
  to { opacity: 1; transform: none; }
}

.modal-card h2 { font-size: 19px; font-weight: 650; margin-bottom: 8px; }
.modal-card p { color: var(--muted); font-size: 14.5px; }
.modal-actions { display: flex; gap: 10px; margin-top: 22px; }
.modal-actions .btn { flex: 1; }

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-soft);
  font-size: 14px;
  cursor: pointer;
}

.check input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; }

.radios { display: grid; gap: 8px; margin-top: 14px; }

.radio {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 14.5px;
  cursor: pointer;
}

.radio input { accent-color: var(--accent); }
.radio.checked { border-color: rgba(124, 245, 196, 0.5); background: rgba(124, 245, 196, 0.06); }

textarea.note {
  width: 100%;
  margin-top: 12px;
  min-height: 74px;
  resize: vertical;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  padding: 10px 12px;
}

textarea.note:focus { outline: none; border-color: rgba(124, 245, 196, 0.5); }

/* -------------------------------------------------------------------- chat */

.chat-shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 820px;
  margin: 0 auto;
  border-left: 1px solid var(--line-soft);
  border-right: 1px solid var(--line-soft);
  background: var(--bg);
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(10, 11, 13, 0.9);
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  font-size: 15px;
  text-decoration: none;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  font-size: 12.5px;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: var(--surface);
  max-width: 42vw;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.status .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted-2);
  flex: 0 0 auto;
}

.status.live .dot { background: var(--accent); box-shadow: 0 0 0 3px rgba(124, 245, 196, 0.15); }
.status.searching .dot { background: #ffd166; animation: pulse 1.2s infinite; }
.status.dead .dot { background: var(--danger); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.chat-actions { display: flex; gap: 8px; }
.chat-actions .btn { padding: 8px 14px; font-size: 13px; }

.thread {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
}

.thread::-webkit-scrollbar { width: 8px; }
.thread::-webkit-scrollbar-thumb { background: #242832; border-radius: 8px; }

.sys {
  align-self: center;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted-2);
  padding: 6px 12px;
  max-width: 90%;
}

.msg { display: flex; }
.msg.me { justify-content: flex-end; }

.bubble {
  max-width: min(78%, 540px);
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 15px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border-bottom-left-radius: 6px;
  animation: rise 0.16s ease-out;
}

.msg.me .bubble {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-ink);
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 6px;
  font-weight: 500;
}

.msg.pending .bubble { opacity: 0.6; }

@keyframes rise {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.empty {
  margin: auto;
  text-align: center;
  padding: 40px 16px;
  max-width: 400px;
}

.empty h2 { font-size: 19px; font-weight: 620; margin-bottom: 10px; }
.empty p { color: var(--muted); font-size: 14.5px; }

.loader { display: inline-flex; gap: 6px; margin-bottom: 22px; }

.loader span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.35;
  animation: bounce 1.1s infinite;
}

.loader span:nth-child(2) { animation-delay: 0.15s; }
.loader span:nth-child(3) { animation-delay: 0.3s; }

@keyframes bounce {
  0%, 100% { transform: translateY(0); opacity: 0.3; }
  40% { transform: translateY(-6px); opacity: 1; }
}

.typing {
  height: 22px;
  padding: 0 18px;
  font-size: 12.5px;
  color: var(--muted-2);
  font-style: italic;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.typing.show { opacity: 1; }

.composer {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  padding: 10px 16px 12px;
  border-top: 1px solid var(--line-soft);
  background: var(--bg);
}

.composer textarea {
  flex: 1 1 auto;
  resize: none;
  max-height: 140px;
  min-height: 44px;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  line-height: 1.4;
}

.composer textarea:focus {
  outline: none;
  border-color: rgba(124, 245, 196, 0.45);
  box-shadow: 0 0 0 3px rgba(124, 245, 196, 0.08);
}

.composer textarea:disabled { opacity: 0.5; }
.composer .btn { height: 44px; padding: 0 20px; }

.composer-note {
  padding: 0 16px 10px;
  font-size: 11.5px;
  color: var(--muted-2);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.composer-note .count.over { color: var(--danger); }

.banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(255, 209, 102, 0.08);
  border-top: 1px solid rgba(255, 209, 102, 0.2);
  font-size: 13.5px;
  color: #ffd166;
}

.banner.show { display: flex; }

.banner .btn {
  padding: 6px 14px;
  font-size: 13px;
  border-color: rgba(255, 209, 102, 0.35);
  color: #ffd166;
  background: transparent;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 12px);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 80;
  max-width: 90vw;
  text-align: center;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* --------------------------------------------------------------- responsive */

@media (max-width: 860px) {
  .hero { padding: 64px 0 52px; }
  .block { padding: 34px 0; }
  .chat-shell { border: none; }
  .status { max-width: none; }
  .chat-head .brand span.name { display: none; }
}

@media (max-width: 560px) {
  .chat-actions .btn { padding: 8px 11px; }
  .chat-head { gap: 8px; padding: 10px 12px; }
  .status { font-size: 12px; padding: 5px 10px; }
  .thread { padding: 14px 12px 6px; }
  .composer { padding: 8px 12px 10px; }
  .composer-note { padding: 0 12px 8px; }
  .bubble { max-width: 84%; }
}

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