/* sarvar·ai — monoxrom, hunarmand minimalizm. Siyoh, oq, nozik chiziqlar. */

:root {
  --bg: #fbfaf9;
  --ink: #1c1b1a;
  --muted: #928f8a;
  --hair: #e7e5e1;
  --sans: -apple-system, "Helvetica Neue", "Inter", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151413;
    --ink: #e9e7e4;
    --muted: #807d78;
    --hair: #2b2a28;
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

button { transition: color .12s ease, background .12s ease, border-color .12s ease; }

/* ── Masthead ─────────────────────────────── */

.masthead {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--hair);
  z-index: 10;
}

.masthead-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.brand {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .34em;
  text-transform: lowercase;
}

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

.reset {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .08em;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
}

.reset:hover { color: var(--ink); }

/* ── Suhbat oqimi ─────────────────────────── */

.feed {
  flex: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 72px 24px 48px;
}

.intro h1 {
  font-size: clamp(24px, 5vw, 31px);
  font-weight: 550;
  line-height: 1.3;
  letter-spacing: -.015em;
  max-width: 24ch;
  margin-bottom: 18px;
}

.intro-note {
  color: var(--muted);
  font-size: 15px;
  max-width: 50ch;
  margin-bottom: 56px;
}

.samples { list-style: none; }

.samples li { border-top: 1px solid var(--hair); }
.samples li:last-child { border-bottom: 1px solid var(--hair); }

.samples button {
  font-family: var(--sans);
  font-size: 15px;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 14px 0;
  text-align: left;
  width: 100%;
  display: flex;
  gap: 14px;
  align-items: baseline;
}

.samples button::before {
  content: "—";
  flex: none;
}

.samples button:hover { color: var(--ink); }

.exchange { padding: 36px 0 10px; }

.exchange + .exchange { border-top: 1px solid var(--hair); }

.turn { margin-bottom: 30px; }

.turn-head {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 10px;
}

.turn.sarvar .turn-head .who { color: var(--ink); }

.turn-body { white-space: pre-wrap; }

.turn-body p { margin-bottom: .9em; }
.turn-body p:last-child { margin-bottom: 0; }

.turn.user .turn-body { color: var(--muted); }

.turn.sarvar .turn-body { font-size: 16.5px; }

/* yozayotganda: yonib-o'chuvchi kursor */
.cursor {
  display: inline-block;
  width: 8px;
  height: 17px;
  background: var(--ink);
  vertical-align: text-bottom;
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.error-note {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

/* ── Yozish paneli ────────────────────────── */

.composer {
  position: sticky;
  bottom: 0;
  background: var(--bg);
  border-top: 1px solid var(--hair);
}

.composer-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 18px 24px 20px;
  display: flex;
  align-items: flex-end;
  gap: 18px;
}

#input {
  flex: 1;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: none;
  border: none;
  border-bottom: 1px solid var(--hair);
  padding: 6px 0;
  resize: none;
  outline: none;
  max-height: 130px;
  transition: border-color .12s ease;
}

#input:focus { border-bottom-color: var(--ink); }

#input::placeholder { color: var(--muted); }

#send {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: lowercase;
  color: var(--ink);
  background: none;
  border: 1px solid var(--ink);
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 999px;
}

#send:hover:not(:disabled) { background: var(--ink); color: var(--bg); }
#send:disabled { border-color: var(--hair); color: var(--muted); cursor: default; }

@media (max-width: 480px) {
  .feed { padding: 44px 18px 32px; }
  .masthead-inner, .composer-inner { padding-left: 18px; padding-right: 18px; }
  .turn.sarvar .turn-body { font-size: 16px; }
}
