/* Город Почти Центр — фирменный стиль канала «Как тут живут».
   Фон — светлый бетон панельки, а не бумага: холодный серый, тёплые только посылки и окна.
   Плоская 2D-иллюстрация, вечернее пасмурное небо, панельки с горящими окнами,
   белый заголовок с чёрной обводкой, жёлтая плашка, красный акцент. */

@font-face { font-family: "Unbounded"; font-style: normal; font-display: swap; font-weight: 200 900;
  src: url("fonts/unbounded-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Unbounded"; font-style: normal; font-display: swap; font-weight: 200 900;
  src: url("fonts/unbounded-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Onest"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url("fonts/onest-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url("fonts/onest-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --ink: #16181D;
  --ink-2: #3B3F4A;
  --muted: #565B68;
  --paper: #E7E8EB;
  --paper-2: #D6D9DF;
  --card: #F7F7F8;
  --yellow: #FFC400;
  --yellow-2: #FFD84D;
  --red: #FF3B30;
  --red-text: #C42A1F;
  --dusk: #2F3852;
  --dusk-2: #232A3F;
  --kraft: #D9BC8C;
  --kraft-2: #C9A56E;
  --tape: #F1E3C2;
  --line: #16181D;
  --radius: 4px;
  --display: "Unbounded", "Arial Black", sans-serif;
  --body: "Onest", "Segoe UI", Roboto, sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1160px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scrollbar-color: var(--ink-2) var(--paper-2); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.55 var(--body); overflow-x: hidden; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--red); }
::selection { background: var(--yellow); color: var(--ink); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; box-shadow: 0 0 0 6px var(--yellow); border-radius: 2px; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--paper-2); }
::-webkit-scrollbar-thumb { background: var(--ink-2); border: 3px solid var(--paper-2); border-radius: 8px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--yellow); padding: 10px 14px; font-weight: 700; z-index: 50; }
.skip:focus { left: 8px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- шапка ---------- */
.top { position: absolute; inset: 0 0 auto 0; z-index: 10; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: #fff;
  font: 800 15px/1.1 var(--display); letter-spacing: .01em; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand span { text-shadow: 0 2px 0 var(--ink); }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a.link { color: #fff; text-decoration: none; font-weight: 600; padding: 12px 12px; text-shadow: 0 1px 0 var(--ink); }
.nav a.link:hover { text-decoration: underline; text-decoration-color: var(--yellow); }

/* ---------- кнопки ---------- */
.btn { --bg: var(--yellow); display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 22px; border: 3px solid var(--ink); border-radius: var(--radius);
  background: var(--bg); color: var(--ink); font: 700 16px/1 var(--display); letter-spacing: .01em;
  text-decoration: none; box-shadow: 4px 4px 0 var(--ink); cursor: pointer;
  transition: transform .14s cubic-bezier(.2,.8,.2,1), box-shadow .14s cubic-bezier(.2,.8,.2,1), background-color .14s; }
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); text-decoration: none; }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn.ghost { --bg: #fff; }
.btn.small { min-height: 44px; padding: 0 14px; font-size: 13px; box-shadow: 3px 3px 0 var(--ink); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: 2px 2px 0 var(--ink); }

/* ---------- обложка ---------- */
.hero { position: relative; min-height: min(100svh, 860px); display: grid; align-items: end; overflow: hidden;
  background: var(--dusk); color: #fff; isolation: isolate; }
.hero .art { position: absolute; left: 0; right: 0; bottom: 0; z-index: -1; }
.hero .skyline { width: 100%; height: auto; aspect-ratio: 1200 / 460; }
.art-note { position: absolute; right: var(--gutter); bottom: 10px; margin: 0; font-size: 13px; color: #D6D9DF; text-shadow: 0 1px 2px rgba(22,24,29,.9); }
/* затемнение слева, чтобы текст читался поверх окон; дома остаются кликабельными */
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, rgba(35,42,63,.9) 0%, rgba(35,42,63,.86) 46%, rgba(35,42,63,0) 70%); }
/* текст обложки не перехватывает нажатия: дома под ним остаются кликабельными */
.hero-in { width: 100%; pointer-events: none; }
.hero-in a, .hero-in button, .hero-in .btn { pointer-events: auto; }
.cover-title.fit { font-size: clamp(26px, calc(min(92vw, 1080px) / (var(--n) * .92)), 128px); overflow-wrap: anywhere; }
.hero-in { padding-top: 120px; padding-bottom: clamp(36px, 7vh, 72px); }
.cover-title { margin: 0; font: 900 clamp(44px, 9.6vw, 128px)/.92 var(--display); letter-spacing: -.01em;
  color: #fff; -webkit-text-stroke: .085em var(--ink); paint-order: stroke fill;
  text-shadow: .05em .06em 0 var(--ink); text-wrap: balance; }
.cover-title .line { display: block; }
.plate { display: inline-block; background: var(--yellow); color: var(--ink); border: 3px solid var(--ink);
  padding: .32em .6em .36em; font: 800 clamp(16px, 2.2vw, 24px)/1.15 var(--display); box-shadow: 4px 4px 0 var(--ink);
  transform: rotate(-1.2deg); }
.hero .plate { margin-top: 22px; }
.hero-text { max-width: 560px; margin: 22px 0 0; font-size: clamp(17px, 1.6vw, 19px); color: #fff;
  text-shadow: 0 1px 2px rgba(22,24,29,.85); }
.hero-text b { color: var(--yellow); font-weight: 700; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.tally { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 26px 0 0; padding: 0; list-style: none;
  font: 600 14px/1.3 var(--body); color: #F3EEE4; text-shadow: 0 1px 2px rgba(22,24,29,.9); }
.tally b { font: 800 18px/1 var(--display); color: #fff; margin-right: 6px; }

/* окна загораются один раз при загрузке */
.skyline .win.on.a { animation: lightup .6s steps(2, end) both; animation-delay: var(--d, 0s); }
@keyframes lightup { from { fill: #3A3F52; } to { fill: #FFD45C; } }
.skyline .cat { animation: catin .3s ease-out both; animation-delay: calc(var(--d, 0s) + 1.2s); }
@keyframes catin { from { opacity: 0; } to { opacity: 1; } }
.skyline a.house { cursor: pointer; }
.skyline a.house:hover rect:first-of-type, .skyline a.house:focus rect:first-of-type { filter: brightness(1.12); }
.skyline a.house:focus { outline: none; }
.skyline a.house:focus-visible > rect:first-of-type { stroke: var(--yellow); stroke-width: 5; }

/* ---------- секции ---------- */
section { padding: clamp(56px, 9vw, 112px) 0; }
.h2 { margin: 0 0 18px; font: 800 clamp(28px, 4.4vw, 52px)/1.04 var(--display); letter-spacing: -.01em; text-wrap: balance; max-width: 18ch; }
.h2 em { font-style: normal; color: var(--red-text); }
.lead { margin: 0 0 36px; max-width: 60ch; color: var(--ink-2); font-size: 18px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 0; padding: 0; list-style: none;
  border: 3px solid var(--ink); background: var(--card); box-shadow: 6px 6px 0 var(--ink); }
.steps li { padding: 28px 26px 30px; border-right: 3px solid var(--ink); }
.steps li:last-child { border-right: 0; }
.steps .num { display: block; font: 900 64px/0.9 var(--display); color: var(--yellow); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; margin-bottom: 18px; }
.steps h3 { margin: 0 0 8px; font: 800 20px/1.2 var(--display); }
.steps p { margin: 0; color: var(--ink-2); }

/* лестница уровней */
.levels { display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; gap: 14px; margin: 0; padding: 0; list-style: none; }
.levels li { display: flex; flex-direction: column; justify-content: flex-end; }
.lvl-bar { position: relative; border: 3px solid var(--ink); background: var(--paper-2); box-shadow: 4px 4px 0 var(--ink);
  background-image: radial-gradient(var(--ink-2) 1.2px, transparent 1.3px); background-size: 14px 16px; background-position: 7px 8px; }
.levels li:nth-child(1) .lvl-bar { height: 40px; background-image: none; background: #6B7A44; }
.levels li:nth-child(2) .lvl-bar { height: 90px; }
.levels li:nth-child(3) .lvl-bar { height: 150px; }
.levels li:nth-child(4) .lvl-bar { height: 220px; background-color: var(--yellow); }
.levels li:nth-child(5) .lvl-bar { height: 290px; background-color: var(--dusk); background-image: radial-gradient(#FFD45C 1.4px, transparent 1.5px); }
.lvl-n { margin-top: 14px; font: 900 34px/1 var(--display); }
.lvl-n small { font: 700 13px/1 var(--body); color: var(--muted); }
.lvl-name { font: 700 15px/1.25 var(--display); margin-top: 4px; }
.lvl-note { font-size: 14px; color: var(--ink-2); margin-top: 6px; }
.levels li:nth-child(4) .lvl-note { color: var(--ink); font-weight: 700; }

/* посылки Паши */
.dark { background: var(--dusk); color: #F3EEE4; }
.dark .lead { color: #D8D3CB; }
.dark .h2 em { color: var(--yellow); }
.parcels { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 22px; margin: 0; padding: 0; list-style: none; }
.parcel { position: relative; padding: 26px 18px 18px; background: var(--kraft); color: var(--ink); border: 3px solid var(--ink);
  box-shadow: 5px 5px 0 var(--dusk-2), 5px 5px 0 3px var(--ink); }
.parcel::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 12px;
  background: var(--tape); border-bottom: 2px dashed rgba(22,24,29,.35); pointer-events: none; }
.parcel > * { position: relative; }
.parcel h3 { margin: 0 0 4px; font: 800 18px/1.15 var(--display); }
.parcel .from { display: inline-block; font-weight: 700; font-size: 14px; background: #fff; border: 2px solid var(--ink); padding: 1px 7px; margin-bottom: 10px; }
.parcel p { margin: 0; font-size: 15px; line-height: 1.45; }
.rar { display: inline-block; margin-left: 6px; font: 700 12px/1 var(--display); padding: 4px 6px; border: 2px solid var(--ink); vertical-align: 2px; }
.rar-редкий { background: #9FC3FF; }
.rar-легендарный { background: var(--yellow); }
.rar-обычный { display: none; }

/* топ городов */
.cities { margin: 0; padding: 0; list-style: none; border-top: 3px solid var(--ink); }
.cities li { border-bottom: 3px solid var(--ink); }
.cities a { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 16px; padding: 16px 6px; text-decoration: none; min-height: 64px; }
.cities a:hover { background: var(--card); }
.cities a:hover .c-name { text-decoration: underline; text-decoration-color: var(--red); }
.c-pos { font: 900 26px/1 var(--display); color: var(--ink-2); }
.c-name { font: 800 clamp(18px, 2.4vw, 24px)/1.15 var(--display); }
.c-sub { display: block; font: 400 14px/1.4 var(--body); color: var(--muted); margin-top: 3px; }
.c-lvl { font: 700 13px/1 var(--display); padding: 8px 10px; border: 2px solid var(--ink); background: var(--card); white-space: nowrap; }
.c-lvl.l2 { background: #D7E1B5; } .c-lvl.l3 { background: #BFD3F2; } .c-lvl.l4, .c-lvl.l5 { background: var(--yellow); }
.empty { padding: 26px; border: 3px dashed var(--ink-2); color: var(--ink-2); background: var(--card); }

.rules { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
.nolist { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 10px; }
.nolist li { padding: 8px 12px; border: 2px solid var(--ink); background: var(--card); font-weight: 600; font-size: 15px;
  text-decoration: line-through; text-decoration-color: var(--red); text-decoration-thickness: 3px; }

.cta-band { background: var(--yellow); border-top: 3px solid var(--ink); border-bottom: 3px solid var(--ink); }
.cta-band .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 22px; }
.cta-band .h2 { margin: 0; max-width: 22ch; }
.cta-band .wrap { padding-block: clamp(36px, 6vw, 64px); }
.cta-band .btn { --bg: #fff; }

/* ---------- страница города ---------- */
.hero.city { min-height: min(84svh, 760px); }
.crumbs { margin: 0 0 14px; font-weight: 600; font-size: 15px; text-shadow: 0 1px 2px rgba(22,24,29,.9); }
.crumbs a { color: #fff; display: inline-flex; align-items: center; min-height: 44px; }
.meter { margin-top: 26px; max-width: 520px; }
.meter-bar { height: 22px; border: 3px solid var(--ink); background: rgba(231,232,235,.92); box-shadow: 3px 3px 0 var(--ink); overflow: hidden; }
.meter-bar i { display: block; height: 100%; background: var(--yellow); border-right: 3px solid var(--ink);
  background-image: repeating-linear-gradient(-45deg, transparent 0 8px, rgba(22,24,29,.12) 8px 14px); }
.meter-bar i.w0 { border-right: 0; }
.meter p { margin: 8px 0 0; font-weight: 600; text-shadow: 0 1px 2px rgba(22,24,29,.9); }
.stats { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; padding: 0; list-style: none; }
.stats li { min-width: 140px; padding: 14px 16px; border: 3px solid var(--ink); background: var(--card); box-shadow: 4px 4px 0 var(--ink); }
.stats b { display: block; font: 900 32px/1 var(--display); }
.stats span { font-size: 14px; color: var(--muted); }

.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; margin: 0; padding: 0; list-style: none; }
.fact { position: relative; display: flex; flex-direction: column; background: var(--card); border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); scroll-margin-top: 24px; }
.fact:target { box-shadow: 5px 5px 0 var(--ink), 0 0 0 6px var(--yellow); }
.fact-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; background: var(--dusk); color: #fff; }
.fact-no { font: 800 13px/1 var(--display); letter-spacing: .02em; }
.fact-nick { font: 700 13px/1 var(--display); background: var(--yellow); color: var(--ink); padding: 6px 8px; border: 2px solid var(--ink); max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fact-body { padding: 16px 16px 18px; }
.fact h3, .check-card h3 { margin: 0 0 10px; font: 700 20px/1.3 var(--body); overflow-wrap: anywhere; }
.fact dl, .check-card dl { margin: 0; display: grid; gap: 8px; }
.fact dt, .check-card dt { font-weight: 700; font-size: 13px; color: var(--muted); }
.fact dd, .check-card dd { margin: 0; overflow-wrap: anywhere; }
.fact .src { margin-top: auto; padding: 0 16px 16px; font-size: 14px; }
.fact .src a { overflow-wrap: anywhere; display: inline-flex; align-items: center; min-height: 44px; }

.chron { margin: 0; padding: 0; list-style: none; counter-reset: c; display: grid; gap: 8px; max-width: 520px; }
.chron li { counter-increment: c; display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 2px solid var(--ink); background: var(--card); font-weight: 600; }
.chron li::before { content: counter(c); font: 900 18px/1 var(--display); width: 28px; }
.chron li span:first-of-type { flex: 1; overflow-wrap: anywhere; }

/* ---------- подвал ---------- */
.foot { background: var(--ink); color: #D8D3CB; padding: 44px 0 52px; font-size: 15px; }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 22px 40px; align-items: flex-end; }
.sign { font: 900 clamp(26px, 4vw, 40px)/1 var(--display); color: #fff; -webkit-text-stroke: .06em #000; paint-order: stroke fill; margin: 0 0 10px; }
.foot a { color: #fff; }
.foot ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.foot ul a { display: inline-flex; align-items: center; min-height: 44px; }
.brand-short { display: none; }

/* ---------- адаптив ---------- */
@media (max-width: 860px) {
  .steps { grid-template-columns: 1fr; }
  .steps li { border-right: 0; border-bottom: 3px solid var(--ink); }
  .steps li:last-child { border-bottom: 0; }
  .levels { grid-template-columns: 1fr; gap: 10px; }
  .levels li { display: grid; grid-template-columns: 96px 1fr; grid-template-rows: auto auto auto; column-gap: 16px; align-items: center; }
  .levels .lvl-bar { grid-row: 1 / span 3; height: 70px !important; }
  .levels .lvl-n { margin-top: 0; font-size: 26px; }
  .rules { grid-template-columns: 1fr; }
}
/* на узких экранах заголовок стоит на чистом небе, город — полосой под ним */
@media (max-width: 760px) {
  .hero, .hero.city { min-height: 0; display: flex; flex-direction: column; }
  .hero-in { padding-top: 92px; padding-bottom: 28px; }
  /* город — горизонтальная полоса, её можно листать пальцем; ниже тот же список фактов */
  .hero .art { position: relative; order: 2; width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
  .hero .art::-webkit-scrollbar { display: none; }
  .hero .skyline { width: 900px; max-width: none; }
  .hero::after { display: none; }
  .art-note { position: static; order: 3; padding: 8px var(--gutter) 12px; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .nav a.link { padding: 12px 8px; min-height: 44px; display: inline-flex; align-items: center; }
  .brand-full { display: none; }
  .brand-short { display: inline; }
  .actions .btn { flex: 1 1 100%; }
  .cities a { grid-template-columns: 34px 1fr; }
  .c-lvl { grid-column: 2; justify-self: start; }
  .facts { grid-template-columns: 1fr; }
  .stats li { flex: 1 1 40%; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .skyline .win.on.a, .skyline .cat { animation: none; }
  .btn { transition: none; }
}
