:root {
  color-scheme: light dark;
  --bg: #f6f3ed;
  --fg: #1d2427;
  --muted: #535c60;
  --line: #ddd6c9;
  --accent: #2f6f62;
  --tg: #1b679f;
  --max: #5a3fcf;
  --hint-bg: #e4f1fb;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141819;
    --fg: #ece8e1;
    --muted: #a8afb1;
    --line: #2d3437;
    --accent: #7cc0b0;
    --hint-bg: #10324b;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 1rem/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

main, footer {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
}

main { padding-top: 20px; }

h1 {
  margin: 0;
  font-size: clamp(1.3rem, 6vw, 2.4rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
}

h1 .sub {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.6em;
  font-weight: 500;
  letter-spacing: 0;
}

.chats {
  display: grid;
  gap: 10px;
  margin: 16px 0 12px;
}

@media (min-width: 480px) {
  .chats { grid-template-columns: 1fr 1fr; }
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 10px 16px;
  border-radius: 14px;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 650;
  text-align: center;
  text-decoration: none;
}

.btn:hover { filter: brightness(1.1); }
.btn:focus-visible { outline: 3px solid var(--fg); outline-offset: 3px; }
.btn-tg { background: var(--tg); }
.btn-max { background: var(--max); }
.btn-home { background: var(--accent); color: var(--bg); }

.who { margin: 0 0 22px; color: var(--muted); }

/* Shown by app.js only, right under the Telegram button; no display rule here, so the hidden attribute keeps working. */
.tg-hint {
  padding: 12px 14px;
  border: 2px solid var(--tg);
  border-radius: 14px;
  background: var(--hint-bg);
  color: var(--fg);
  font-size: 1rem;
  line-height: 1.45;
  animation: hint-in 0.25s ease-out;
}

@media (min-width: 480px) {
  .tg-hint { order: 3; grid-column: 1 / -1; }
}

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

@media (prefers-reduced-motion: reduce) {
  .tg-hint { animation: none; }
}

.tg-nick {
  padding: 0 2px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-decoration: underline dotted;
  cursor: pointer;
}

.photo img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
}

.about h2 { margin: 28px 0 8px; font-size: 1.15rem; }
.about p { margin: 0; }

a { color: var(--accent); }

footer {
  margin-top: 36px;
  padding-bottom: 32px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* The rule spans the text column, not the footer's side padding. */
footer::before {
  content: "";
  display: block;
  margin-bottom: 20px;
  border-top: 1px solid var(--line);
}

footer p { margin: 4px 0; }
