/* КТО? — сайт. Графит, крем, оранжевый (палитра из kto-platform/DESIGN.md). Сначала телефон. */
@font-face {
  font-family: Golos;
  src: url("/s/fonts/GolosText.ttf") format("truetype");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  --ground: #222321;
  --ground-2: #2c2d2a;
  --line-dark: #3b3c38;
  --cream: #f5f2e9;
  --cream-2: #ebe7da;
  --ink: #232521;
  --muted-light: #bcbdb6;
  --muted: #5e6258;
  --line: #d8d4c6;
  --orange: #f78343;
  --orange-hover: #ff9a5f;
  --orange-ink: #9a3d06;
  --ok: #2f7547;
  --error: #a12e29;
  --radius: 18px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: Golos, "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--cream);
  background: var(--ground);
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; letter-spacing: -0.02em; }
a { color: inherit; text-underline-offset: 0.2em; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: default; opacity: 0.55; }
svg { flex: none; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; border-radius: 6px; }
.surface :focus-visible { outline-color: var(--orange-ink); }
[hidden] { display: none !important; }
::selection { background: var(--orange); color: var(--ink); }

.skip { position: fixed; left: 16px; top: 8px; z-index: 50; padding: 10px 14px; background: var(--cream); color: var(--ink); transform: translateY(-200%); }
.skip:focus { transform: none; }
.banner { padding: 8px 16px; text-align: center; font-size: 0.8125rem; background: #3a2a1d; color: #ffd2b5; }

/* ── Шапка ── */
.top {
  display: flex; align-items: center; gap: 14px;
  width: min(1040px, 100% - 32px); margin: 0 auto; min-height: 68px;
}
.brand { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.05em; text-decoration: none; line-height: 1; }
.brand span { color: var(--orange); }
.brand.small { font-size: 1.15rem; }
.city { display: inline-flex; align-items: center; gap: 4px; font-size: 0.875rem; color: var(--muted-light); }
.city svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.nav a, .nav button {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px;
  font-size: 0.9rem; font-weight: 600; text-decoration: none; border-radius: 999px;
}
.nav a:hover, .nav button:hover { color: var(--orange); }
.nav .pill { border: 1px solid var(--line-dark); }
.nav .hide-sm { display: none; }

main { flex: 1; width: min(1040px, 100% - 32px); margin: 0 auto; padding: 8px 0 56px; }
main:focus { outline: none; }

/* ── Главная ── */
.hero { max-width: 680px; margin: 20px auto 0; }
.hero h1 { font-size: clamp(2.1rem, 8vw, 3.2rem); line-height: 1.08; font-weight: 700; }
.hero h1 em { font-style: normal; color: var(--orange); }
.hero .lead { margin-top: 14px; font-size: 1.05rem; color: var(--muted-light); max-width: 52ch; }

.surface { background: var(--cream); color: var(--ink); border-radius: var(--radius); color-scheme: light; }
.composer { margin-top: 24px; padding: 14px; }
.composer label { display: block; padding: 4px 4px 8px; font-weight: 700; }
textarea, .input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px; background: #fffdf7;
  padding: 12px 14px; color: var(--ink); font-size: 1.05rem; line-height: 1.45;
}
textarea { min-height: 120px; resize: vertical; }
textarea:focus, .input:focus { outline: none; border-color: var(--ink); }
textarea::placeholder, .input::placeholder { color: #8b8e85; }
.hint { margin: 8px 4px 0; font-size: 0.85rem; color: var(--muted); }
.examples { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 2px; }
.examples button {
  padding: 7px 12px; border-radius: 999px; background: var(--cream-2); font-size: 0.875rem; color: var(--ink);
}
.examples button:hover { background: #e2ddcd; }
.composer .actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 22px; border-radius: 14px;
  background: var(--orange); color: #1d1e1b; font-weight: 700; font-size: 1.02rem; text-decoration: none;
  transition: background-color 160ms ease-out, transform 120ms ease-out;
}
.btn:hover { background: var(--orange-hover); }
.btn:active { transform: translateY(1px); }
.btn.wide { width: 100%; }
.btn.dark { background: var(--ink); color: var(--cream); }
.btn.dark:hover { background: #34362f; }
.btn.ghost { background: transparent; color: inherit; border: 1.5px solid currentColor; }
.btn.ghost:hover { background: rgba(127, 127, 127, 0.08); }
.btn.tg { background: #2aabee; color: #fff; }
.btn.tg:hover { background: #3cb6f2; }
.btn svg { width: 20px; height: 20px; }
.link { color: var(--orange-ink); font-weight: 600; text-decoration: underline; }
.on-dark .link, .link.light { color: var(--orange); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.how { max-width: 680px; margin: 40px auto 0; }
.how h2, .section-title { font-size: 1.35rem; font-weight: 700; }
.steps { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 12px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: 14px; background: var(--ground-2); }
.steps .num {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--orange); color: var(--ink); font-weight: 800;
}
.steps b { display: block; }
.steps span { color: var(--muted-light); font-size: 0.95rem; }
.master-cta { max-width: 680px; margin: 28px auto 0; padding: 20px; border-radius: var(--radius); border: 1.5px solid var(--line-dark); }
.master-cta p { margin-top: 6px; color: var(--muted-light); }
.master-cta .btn { margin-top: 14px; }

/* ── Черновик заявки ── */
.flow { max-width: 680px; margin: 12px auto 0; }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; color: var(--muted-light); font-weight: 600; }
.back:hover { color: var(--cream); }
.quote { margin-top: 10px; padding: 14px 16px; border-left: 3px solid var(--orange); background: var(--ground-2); border-radius: 0 12px 12px 0; color: var(--cream); }
.quote small { display: block; margin-top: 6px; color: var(--muted-light); }
.card { margin-top: 16px; padding: 20px 18px; }
.card h2 { font-size: 1.3rem; font-weight: 700; }
.card .sub { margin-top: 4px; color: var(--muted); }
.question { margin-top: 4px; }
.question h2 { font-size: 1.25rem; }
.step-meta { font-size: 0.8125rem; font-weight: 700; color: var(--orange-ink); text-transform: uppercase; letter-spacing: 0.06em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
  min-height: 44px; padding: 8px 14px; border-radius: 12px; border: 1.5px solid var(--line);
  background: #fffdf7; color: var(--ink); font-weight: 600; text-align: left; line-height: 1.25;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.chip.soft { background: transparent; border-style: dashed; color: var(--muted); font-weight: 500; }
.chip-group-title { margin-top: 16px; font-size: 0.875rem; font-weight: 700; color: var(--muted); }
.catalog { margin-top: 12px; display: grid; gap: 6px; }
.catalog details { border: 1.5px solid var(--line); border-radius: 12px; background: #fffdf7; }
.catalog summary { padding: 12px 14px; font-weight: 700; cursor: pointer; list-style: none; }
.catalog summary::-webkit-details-marker { display: none; }
.catalog .chips { margin: 0; padding: 0 12px 12px; }

.rows { margin: 14px 0 0; display: grid; }
.row { display: grid; grid-template-columns: 96px 1fr auto; gap: 10px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row dt { color: var(--muted); font-size: 0.9rem; }
.row dd { margin: 0; font-weight: 650; }
.row dd.empty { color: var(--muted); font-weight: 500; }
.row .edit { color: var(--orange-ink); font-weight: 600; font-size: 0.9rem; min-height: 36px; padding: 0 4px; }
.row-editor { grid-column: 1 / -1; }
.row-editor .chips { margin-top: 2px; }
.inline-input { display: flex; gap: 8px; margin-top: 10px; }
.inline-input .input { flex: 1; font-size: 1rem; padding: 10px 12px; }
.inline-input .btn { min-height: 46px; padding: 0 16px; }
.note { margin-top: 14px; font-size: 0.875rem; color: var(--muted); }
.notice { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: #fbe7d9; color: #5a2a0c; font-size: 0.95rem; }
.notice.ok { background: #e2efe3; color: #1f4a2c; }
.notice.dark { background: var(--ground-2); color: var(--cream); }
.card .btn.wide { margin-top: 18px; }

/* ── Заявки ── */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 680px; margin: 16px auto 0; }
.page-head h1 { font-size: 1.7rem; }
.list { max-width: 680px; margin: 14px auto 0; display: grid; gap: 10px; }
.req {
  display: block; padding: 16px 18px; text-decoration: none; border-radius: 16px;
  background: var(--ground-2); border: 1px solid var(--line-dark);
}
.req:hover { border-color: #55574f; }
.req h3 { font-size: 1.08rem; }
.req p { margin-top: 4px; color: var(--muted-light); font-size: 0.92rem; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; }
.badge.open { background: #3b2b1f; color: #ffb88c; }
.badge.offers { background: var(--orange); color: var(--ink); }
.badge.closed { background: #33342f; color: var(--muted-light); }
.badge.done { background: #23392a; color: #a6dcb4; }
.req .meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.empty-state { max-width: 680px; margin: 30px auto 0; text-align: center; color: var(--muted-light); }
.empty-state .btn { margin-top: 16px; }

.detail { max-width: 680px; margin: 0 auto; }
.detail .card dl { margin-top: 10px; }
.waiting { display: flex; gap: 14px; align-items: flex-start; }
.pulse { width: 12px; height: 12px; margin-top: 7px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 0 rgba(247, 131, 67, 0.6); animation: pulse 1.8s infinite; flex: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 12px rgba(247, 131, 67, 0); } 100% { box-shadow: 0 0 0 0 rgba(247, 131, 67, 0); } }
.offer { margin-top: 12px; padding: 18px; }
.offer-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.offer h3 { font-size: 1.08rem; }
.stars { color: var(--orange-ink); font-weight: 700; font-size: 0.9rem; white-space: nowrap; }
.offer .facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin-top: 12px; }
.offer .facts dt { color: var(--muted); }
.offer .facts dd { margin: 0; font-weight: 650; }
.offer .msg { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--cream-2); }
.offer .about { margin-top: 10px; color: var(--muted); font-size: 0.92rem; }
.offer .btn { margin-top: 14px; }
.contact { display: grid; gap: 8px; margin-top: 14px; }
.rating { display: flex; gap: 6px; margin-top: 12px; }
.rating button { width: 48px; height: 48px; border-radius: 12px; border: 1.5px solid var(--line); background: #fffdf7; font-size: 1.4rem; color: #b9b5a6; }
.rating button[aria-pressed="true"] { color: var(--orange); border-color: var(--orange); }
.detail .section-title { margin-top: 24px; }
.note.on-dark { color: var(--muted-light); margin-top: 18px; }
.danger-link { display: inline-block; margin-top: 18px; color: var(--muted-light); font-size: 0.9rem; text-decoration: underline; }

/* ── Окно входа ── */
.sheet { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(10, 10, 9, 0.6); }
.sheet-card {
  position: relative; width: 100%; max-width: 480px; max-height: 92vh; overflow: auto;
  padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0;
  background: var(--cream); color: var(--ink); color-scheme: light;
  animation: up 200ms ease-out;
}
@keyframes up { from { transform: translateY(24px); opacity: 0.4; } }
.sheet-card h2 { font-size: 1.35rem; padding-right: 36px; }
.sheet-card .sub { margin-top: 6px; color: var(--muted); }
.sheet-close { position: absolute; right: 12px; top: 12px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.sheet-close:hover { background: var(--cream-2); color: var(--ink); }
.sheet-card .btn { margin-top: 16px; }
.or { display: flex; align-items: center; gap: 10px; margin: 18px 0 2px; color: var(--muted); font-size: 0.85rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; font-size: 0.92rem; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--ink); flex: none; }
.field-label { display: block; margin-top: 14px; font-weight: 700; font-size: 0.95rem; }
.field-label + .input { margin-top: 6px; }
.err { margin-top: 12px; color: var(--error); font-weight: 600; font-size: 0.92rem; }
.wait-line { display: flex; align-items: center; gap: 10px; margin-top: 14px; color: var(--muted); font-size: 0.92rem; }

.toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 60; transform: translateX(-50%);
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px; background: var(--cream); color: var(--ink);
  font-weight: 600; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

/* ── Подвал ── */
.foot { width: min(1040px, 100% - 32px); margin: 0 auto; padding: 22px 0 calc(26px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-dark); color: var(--muted-light); font-size: 0.875rem; }
.foot-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.foot-row + .foot-row { margin-top: 10px; }
.foot .links a { color: var(--muted-light); }
.foot .links a:hover { color: var(--cream); }

@media (min-width: 720px) {
  .nav .hide-sm { display: inline-flex; }
  .hero { margin-top: 48px; }
  .composer { padding: 20px; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .steps li { flex-direction: column; }
  .sheet { align-items: center; }
  .sheet-card { border-radius: 22px; padding: 28px 26px; }
  .card { padding: 26px 26px; }
  .row { grid-template-columns: 120px 1fr auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
