:root {
  color-scheme: light;
  --ink: #111418;
  --ink2: #1e242c;
  --ink3: #262c35;
  --paper: #f6f5f1;
  --paper2: #f3f2ee;
  --white: #ffffff;
  --map: #e8ebe3;
  --muted: #5b5f66;
  --muted-dark: #a9aeb6;
  --border: #dad8d0;
  --divider: #eceae3;
  --accent: #d4ff3a;
  --accent-text: #4f6b00;
  --danger: #b3341a;
  --display: 'Unbounded', system-ui, sans-serif;
  --body: 'Manrope', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --radius: 20px;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  background: rgba(246, 245, 241, 0.92);
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.langs { display: flex; gap: 2px; padding: 4px; border-radius: 14px; background: var(--divider); }
.langs button {
  min-width: 44px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.langs button[aria-checked='true'] { background: var(--ink); color: var(--paper2); }

/* ---------- Home ---------- */

.home { max-width: 1080px; margin: 0 auto; padding: 32px 16px 64px; display: flex; flex-direction: column; gap: 48px; }

.hero { display: flex; flex-direction: column; gap: 20px; max-width: 720px; }
.hero h1 { margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(32px, 6vw, 56px); line-height: 1.08; letter-spacing: -0.035em; }
.hero p { margin: 0; font-size: clamp(16px, 2.2vw, 19px); color: var(--muted); max-width: 560px; }

.search { display: flex; gap: 10px; max-width: 520px; }
.search label { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; height: 64px; padding: 0 18px; border-radius: 20px; background: var(--white); border: 2px solid var(--ink); }
.search label span { font-family: var(--mono); font-size: 20px; color: #8a8e95; }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font-family: var(--mono); font-weight: 700; font-size: 20px; letter-spacing: 0.06em; text-transform: uppercase; }
.search input::placeholder { color: #8a8e95; text-transform: none; letter-spacing: 0; font-family: var(--body); font-weight: 500; font-size: 16px; }
.search button { flex-shrink: 0; height: 64px; padding: 0 clamp(16px, 4vw, 24px); border: 0; border-radius: 20px; background: var(--accent); font-weight: 800; font-size: 16px; }
.form-error { margin: -8px 0 0; color: var(--danger); font-weight: 600; font-size: 14px; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.step { padding: 22px; border-radius: 24px; background: var(--white); display: flex; flex-direction: column; gap: 8px; }
.step b { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.step h2 { margin: 0; font-size: 19px; font-weight: 800; }
.step p { margin: 0; color: var(--muted); font-size: 15px; }

.app-box { padding: 24px; border-radius: 28px; background: var(--ink); color: var(--paper2); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.app-box h2 { margin: 0 0 4px; font-family: var(--display); font-size: 22px; letter-spacing: -0.02em; }
.app-box p { margin: 0; color: var(--muted-dark); }
.stores { display: flex; flex-wrap: wrap; gap: 8px; }
.store { display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 16px; border-radius: 14px; background: var(--paper2); color: var(--ink); text-decoration: none; font-weight: 700; font-size: 14px; }
.store.ghost { background: transparent; color: var(--paper2); border: 1px solid #343b45; }
.soon { color: var(--muted-dark); font-weight: 600; font-size: 14px; }

.demo-note { align-self: flex-start; padding: 8px 12px; border-radius: 12px; background: #eae8e1; font-size: 13px; font-weight: 600; color: #34383f; }

/* ---------- Place ---------- */

.place { display: grid; grid-template-columns: 1fr; min-height: calc(100vh - 64px); }
.map-wrap { position: relative; height: 46vh; min-height: 280px; background: var(--map); }
#map { position: absolute; inset: 0; }
.map-msg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-weight: 600; }
.locate { position: absolute; right: 12px; bottom: 28px; z-index: 2; width: 48px; height: 48px; border: 0; border-radius: 16px; background: var(--white); display: grid; place-items: center; box-shadow: 0 4px 14px rgba(17, 20, 24, 0.12); }

.card { position: relative; margin-top: -16px; padding: 20px 16px 40px; border-radius: 28px 28px 0 0; background: var(--paper); display: flex; flex-direction: column; gap: 16px; }

.code-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.code { font-family: var(--display); font-weight: 700; font-size: 44px; line-height: 1; letter-spacing: -0.04em; }
.code em { font-style: normal; color: var(--accent-text); }
.kind { padding: 5px 10px; border-radius: 9px; background: var(--ink); color: var(--paper2); font-weight: 800; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }

.card h1 { margin: 0; font-size: 24px; line-height: 1.25; font-weight: 800; letter-spacing: -0.01em; }
.address { margin: -8px 0 0; color: var(--muted); }

.photos { display: flex; gap: 8px; overflow-x: auto; }
.photos img { width: 120px; height: 90px; object-fit: cover; border-radius: 14px; flex-shrink: 0; background: var(--border); }

.details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.detail { padding: 12px; border-radius: 16px; background: var(--white); }
.detail span { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.detail b { font-size: 18px; }

.landmark { display: flex; gap: 12px; padding: 14px; border-radius: 16px; background: var(--white); }
.landmark b { display: block; font-size: 13px; }
.landmark p { margin: 2px 0 0; font-size: 14px; color: #4a4e55; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 0 20px; border-radius: 18px; border: 1px solid var(--border); background: var(--white); text-decoration: none; font-weight: 700; font-size: 15px; }
.btn.primary { flex: 1 1 220px; border: 0; background: var(--ink); color: var(--paper2); font-size: 16px; }
.btn.primary svg { color: var(--accent); }

.own { padding: 18px; border-radius: 22px; background: var(--ink); color: var(--paper2); display: flex; flex-direction: column; gap: 12px; }
.own b { font-size: 17px; }
.own p { margin: -8px 0 0; color: var(--muted-dark); font-size: 14px; }

.missing h1 { font-family: var(--display); font-size: 24px; letter-spacing: -0.02em; }
.tips { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.tips li { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 16px; background: var(--white); font-size: 15px; }
.tips li::before { content: counter(tip); counter-increment: tip; flex-shrink: 0; width: 28px; height: 28px; border-radius: 9px; background: var(--ink); color: var(--paper2); display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.tips { counter-reset: tip; }

.back { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 700; text-decoration: none; color: var(--muted); }

.loading { padding: 64px 16px; text-align: center; color: var(--muted); font-weight: 600; }

/* Map pin, drawn inside the Yandex map */
.pin { position: absolute; transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center; }
.pin b { font: 700 15px/1 var(--mono); padding: 9px 12px; border-radius: 12px; background: var(--accent); color: var(--ink); border: 2px solid var(--ink); white-space: nowrap; }
.pin i { width: 3px; height: 14px; background: var(--ink); }
.me { position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #3d7be0; border: 3px solid #fff; box-shadow: 0 0 0 8px rgba(61, 123, 224, 0.2); transform: translate(-50%, -50%); }

.noscript { padding: 24px; text-align: center; }

@media (min-width: 900px) {
  .place { grid-template-columns: minmax(0, 1fr) 460px; height: calc(100vh - 64px); }
  .map-wrap { height: auto; order: 1; }
  .card { order: 2; margin-top: 0; border-radius: 0; padding: 28px; overflow-y: auto; }
  .locate { bottom: 16px; }
}
