/* Правда — мини-приложение. Тёплый тёмный фон, охра дозированно:
   момент поворота, вывод, задание. Антиква — то, что написал человек.
   Гротеск — то, что говорит приложение. Шрифты лежат рядом, внешних нет. */

@font-face { font-family: "PT Sans"; src: url("/fonts/PTSans-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "PT Sans"; src: url("/fonts/PTSans-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "PT Serif"; src: url("/fonts/PTSerif-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "PT Serif"; src: url("/fonts/PTSerif-Italic.ttf") format("truetype"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --bg: #151311;
  --bg-2: #1e1b17;
  --line: #2e2a24;
  --line-2: #3d372f;
  --muted: #7a746c;
  --text-2: #a3a3a3;
  --text: #ffffff;
  --accent: #c8964e;
  --accent-dim: #5c4a2e;
  --accent-bg: #221e19;
  --danger: #e08a7a;
  --sans: "PT Sans", system-ui, sans-serif;
  --serif: "PT Serif", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
[hidden] { display: none !important; }

.screen { min-height: 100%; display: flex; flex-direction: column; }
.screen.center { align-items: center; justify-content: center; gap: 1rem; }
.muted { color: var(--muted); }
.logo-lg { width: 84px; height: 84px; display: block; }

/* ---------- вход ---------- */
.gate { max-width: 26rem; margin: 0 auto; padding: 3.5rem 1.5rem 2.5rem; display: flex; flex-direction: column; align-items: center; text-align: center; }
.gate h1 { font-size: 2.4rem; font-weight: 700; letter-spacing: -0.02em; margin: 1.1rem 0 0.4rem; }
.lead { color: var(--text-2); margin: 0 0 1.75rem; }
.gate p { margin: 0.5rem 0; }
.gate .note { margin-top: 2rem; }
#promo-block, #gender-block { width: 100%; }
#gender-block .two { display: flex; gap: 0.7rem; justify-content: center; margin-top: 0.9rem; }

.note { border: 1px solid var(--line-2); border-radius: 12px; padding: 0.8rem 1rem; color: var(--text-2); font-size: 0.85rem; text-align: left; }
.note p { margin: 0.25rem 0; }

/* ---------- формы и кнопки ---------- */
.row-form { display: flex; gap: 0.6rem; width: 100%; margin-top: 0.9rem; }
.row-form input {
  flex: 1; min-width: 0; font: 1rem var(--sans); color: var(--text);
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 0.7rem 1.1rem;
}
.row-form input:focus { outline: none; border-color: var(--accent-dim); }

.btn {
  font: inherit; font-weight: 700; color: var(--bg); background: var(--text);
  border: 0; border-radius: 999px; padding: 0.7rem 1.4rem; cursor: pointer;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.35; cursor: default; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line-2); }
.link { font: inherit; background: none; border: 0; color: var(--muted); cursor: pointer; }
.link:active { color: var(--text); }

/* ---------- чат ---------- */
.bar {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 0.6rem;
  padding: 0.7rem 1.1rem calc(0.7rem + env(safe-area-inset-top, 0px)); padding-top: calc(0.7rem + env(safe-area-inset-top, 0px));
  background: rgba(21, 19, 17, 0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); font-weight: 700;
}
.bar-title { letter-spacing: 0.01em; }
.bar .link { margin-left: auto; font-size: 0.9rem; font-weight: 400; }

.log { flex: 1; width: 100%; max-width: 40rem; margin: 0 auto; padding: 1.4rem 1.1rem 1rem; display: flex; flex-direction: column; gap: 0.9rem; }
.msg { max-width: 88%; white-space: pre-wrap; word-wrap: break-word; animation: rise 0.25s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.msg.assistant { align-self: flex-start; }
.msg.user {
  align-self: flex-end; font-family: var(--serif); font-size: 1.05rem;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px 16px 4px 16px;
  padding: 0.6rem 0.95rem;
}
.msg.error { align-self: center; color: var(--danger); font-size: 0.95rem; text-align: center; }
.typing { color: var(--muted); }
.typing::after { content: "…"; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: 0.2; } }

.composer {
  position: sticky; bottom: 0; display: flex; gap: 0.6rem; align-items: flex-end;
  width: 100%; max-width: 40rem; margin: 0 auto;
  padding: 0.7rem 1.1rem calc(0.7rem + env(safe-area-inset-bottom, 0px));
  background: rgba(21, 19, 17, 0.92); backdrop-filter: blur(8px);
}
.composer textarea {
  flex: 1; resize: none; font: 1.05rem/1.5 var(--serif); color: var(--text);
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 18px; padding: 0.65rem 1rem; max-height: 40vh;
}
.composer textarea:focus { outline: none; border-color: var(--accent-dim); }
.btn-round { width: 2.9rem; height: 2.9rem; padding: 0; border-radius: 50%; font-size: 1.05rem; display: flex; align-items: center; justify-content: center; }

/* ---------- итог ---------- */
.result { align-self: stretch; background: var(--accent-bg); border: 1px solid var(--accent-dim); border-radius: 18px; padding: 1.2rem 1.3rem; }
.result h2 { margin: 0 0 0.8rem; font-size: 1.15rem; color: var(--accent); }
.result dl { margin: 0; }
.result dt { color: var(--muted); font-size: 0.85rem; margin-top: 0.65rem; }
.result dd { margin: 0.1rem 0 0; font-family: var(--serif); }
.result dd.belief { color: var(--accent); font-size: 1.1rem; }
.result-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.1rem; }
.hint { color: var(--muted); font-size: 0.85rem; margin: 0.8rem 0 0; }

/* ---------- обратная связь ---------- */
.feedback { width: 100%; max-width: 40rem; margin: 0 auto; padding: 0 1.1rem 1rem; }
.feedback-q { color: var(--accent); font-weight: 700; margin: 0.4rem 0 0; }
.feedback .link { margin-top: 0.5rem; font-size: 0.9rem; }
