:root {
  /* Palette of the bot avatar: deep navy, white and a neon blue accent */
  --bg: #f3f5fb;
  --surface: #ffffff;
  --surface-2: #e9edf7;
  --text: #141a30;
  --muted: #48506e;
  --border: #dde2ef;
  --accent: #2f6bef;
  --accent-fill: #2f6bef;
  --accent-hover: #2459d6;
  --accent-text: #ffffff;
  --accent-soft: #e3ecff;
  --danger: #d64545;
  --success: #2f9e5b;
  --telegram: #2aabee;
  --mine: #2f6bef;
  --mine-text: #ffffff;
  --theirs: #ffffff;
  --shadow: 0 6px 24px rgba(20, 26, 48, 0.08);
  --radius: 16px;
  --photo-opacity: 0.6;
  --scrim: 45%;
  --text-glow: rgba(255, 255, 255, 0.6);
  color-scheme: light;
}

/* Dark theme: chosen with the theme button (data-theme on <html>), else follows the system */
:root[data-theme="dark"] {
  --bg: #12172b;
  --surface: #1a2140;
  --surface-2: #232c50;
  --text: #eef1f8;
  --muted: #9aa3c2;
  --border: #2b3558;
  --accent: #4d8dff;
  /* Filled buttons stay deep blue with white text; the light --accent is for links and icons */
  --accent-fill: #2f6bef;
  --accent-hover: #2459d6;
  --accent-text: #ffffff;
  --accent-soft: #1f3366;
  --mine: #2f6bef;
  --theirs: #1f2846;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
  --photo-opacity: 0.5;
  --scrim: 60%;
  --text-glow: var(--bg);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #12172b;
    --surface: #1a2140;
    --surface-2: #232c50;
    --text: #eef1f8;
    --muted: #9aa3c2;
    --border: #2b3558;
    --accent: #4d8dff;
    --accent-fill: #2f6bef;
    --accent-hover: #2459d6;
    --accent-text: #ffffff;
    --accent-soft: #1f3366;
    --mine: #2f6bef;
    --theirs: #1f2846;
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
    --photo-opacity: 0.5;
    --scrim: 60%;
    --text-glow: var(--bg);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none !important;
  transition: background 0.15s, transform 0.05s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--accent-fill); color: var(--accent-text); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
/* Same weight as the primary button in another hue: for an equal alternative (group vs one-on-one chat) */
.btn-violet { background: #6c4ce8; color: #fff; }
.btn-violet:hover:not(:disabled) { background: #5a3bd6; }
.btn-secondary { background: var(--accent-soft); color: var(--accent); }
.btn-secondary:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 22%, var(--accent-soft)); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
/* Outlined button on a faint neutral backing, so it stays legible over the backdrop photos */
.btn-outline { --outline-bg: color-mix(in srgb, var(--surface) 88%, transparent); background: var(--outline-bg); color: var(--accent); border-color: var(--accent); }
.btn-outline:hover { background: color-mix(in srgb, var(--accent) 12%, var(--outline-bg)); text-decoration: none; }
.btn-telegram.btn-outline { background: var(--outline-bg); color: var(--telegram); border-color: var(--telegram); }
.btn-telegram.btn-outline:hover { background: color-mix(in srgb, var(--telegram) 12%, var(--outline-bg)); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-telegram { background: var(--telegram); color: #fff; gap: 12px; }
.btn-telegram .icon { width: 22px; height: 22px; }
/* Two-line button text: the label and a small hint under it */
.btn-label { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; text-align: left; }
.btn-label small { font-size: 12px; font-weight: 500; opacity: 0.85; }
.btn-small { padding: 8px 14px; font-size: 14px; }
.btn-wide { width: 100%; }

.muted { color: var(--muted); }

/* Landing pages */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 16px 16px;
}
.site-header nav { display: flex; align-items: center; gap: 18px; font-size: 15px; }
/* EN | RU switch with the current language highlighted (landing header and chat) */
.lang-switch { display: inline-flex; padding: 2px; border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 600; }
.lang-switch > * { padding: 3px 9px; border-radius: 999px; color: var(--muted); }
.lang-switch a:hover { color: var(--text); text-decoration: none; }
.lang-switch .active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.theme-toggle:hover { background: var(--surface-2); color: var(--text); }
.theme-toggle .icon { width: 20px; height: 20px; }
/* Shows the theme the button switches to */
.theme-toggle .i-sun, :root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: inline; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; color: var(--text); }
.logo:hover { text-decoration: none; }
.brand-tagline { font-weight: 400; color: var(--muted); white-space: nowrap; }
/* Narrow phones: the name alone, the tagline doesn't fit next to the navigation */
@media (max-width: 520px) { .brand-tagline { display: none; } }
.logo-mark { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.icon {
  width: 1.2em;
  height: 1.2em;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.25em;
}

/* Short pages still keep the footer at the bottom of the window */
body.landing { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.landing main { flex: 1 0 auto; width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 16px; }
/* A small shadow of the page color behind the text separates it from the backdrop photos */
.landing main :is(h1, h2, p) { text-shadow: 0 0 3px var(--text-glow), 0 1px 2px var(--text-glow); }
/* A soft band of the page color behind the text column keeps it readable over the backdrop photos.
   It runs the full page height (header included), so it has no visible top edge. */
body.landing::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: min(100%, 1040px);
  transform: translateX(-50%);
  z-index: -1; /* above .page-bg: same level, later in the document */
  pointer-events: none;
  background: linear-gradient(to right,
    transparent,
    color-mix(in srgb, var(--bg) var(--scrim), transparent) 22%,
    color-mix(in srgb, var(--bg) var(--scrim), transparent) 78%,
    transparent);
}

.hero { text-align: center; padding: 32px 0 32px; }
.hero h1 { font-size: clamp(30px, 6vw, 52px); letter-spacing: -0.02em; margin-bottom: 0.2em; }
.hero .lead { font-size: clamp(17px, 2.4vw, 21px); color: var(--muted); max-width: 680px; margin: 0 auto 96px; }

/* Page backdrop behind the top of the landing pages: a girl and a guy texting each other,
   faint and with soft edges. Both photos are cropped to the same 4:5 frame with the face in the middle. */
body.landing { position: relative; isolation: isolate; }
.page-bg {
  /* A fixed-height strip at the top of the page (the hero), whatever the window size */
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 640px;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
/* Each photo stands on its own side of the center, overlapping by 80px; on narrow screens
   they get narrower (cropped) instead of sliding over each other */
.page-bg::before, .page-bg::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: min(55vw, 512px); /* 4:5 of the strip height */
  background-size: cover;
  background-position: center 30%;
  opacity: var(--photo-opacity);
  /* Fades out to every edge (no visible borders), extra softly on the outer side */
  -webkit-mask-image: radial-gradient(closest-side, #000 60%, transparent), linear-gradient(var(--fade-dir), transparent, #000 50%);
  mask-image: radial-gradient(closest-side, #000 60%, transparent), linear-gradient(var(--fade-dir), transparent, #000 50%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}
.page-bg::before { right: calc(50% - 40px); --fade-dir: to right; background-image: url("bg-woman.jpg"); }
.page-bg::after { left: calc(50% - 40px); --fade-dir: to left; background-image: url("bg-man.jpg"); }
/* Phones: each one hugs its own screen edge, half off the screen, so they stay apart */
@media (max-width: 640px) {
  .page-bg { height: 580px; }
  .page-bg::before, .page-bg::after { width: 75vw; }
  .page-bg::before { right: auto; left: -15vw; }
  .page-bg::after { left: auto; right: -15vw; }
}
/* Buttons stacked and centered, the same on every screen width */
.cta { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.cta .btn { padding: 15px 30px; font-size: 18px; }
.cta .btn-telegram { padding-block: 9px; }
.hint { color: var(--muted); font-size: 14px; font-weight: 500; margin-top: 14px; }


.content { max-width: 760px; margin: 0 auto; }
.page-title { max-width: 760px; margin: 40px auto 24px; font-size: clamp(28px, 5vw, 40px); letter-spacing: -0.02em; }
.content section { margin-bottom: 32px; }
.content h2 { font-size: 26px; }
.content p, .content li { font-size: 17px; }

.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 10px;
}
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 10px 0 0; color: var(--muted); }



.site-footer {
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }
