:root {
  --primary: #ed1c24;
  --primary-dark: #cb1119;
  --navy: #061c29;
  --ink: #11181f;
  --muted: #697078;
  --surface: #ffffff;
  --soft: #f7f8f9;
  --line: #e3e6e8;
  --shadow: 0 8px 30px rgba(12, 22, 34, .09);
  --radius: 10px;
  --page: calc(100% - clamp(32px, 6vw, 112px));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; width: 100%; min-width: 320px; overflow-x: hidden; font-family: "Manrope", Arial, sans-serif; color: var(--ink); background: #fff; font-size: 15px; line-height: 1.45; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.page-width { width: var(--page); margin-inline: auto; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 1000; transform: translateY(-150%); background: #fff; color: #111; padding: 10px 14px; border-radius: 6px; }
.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: 3px solid rgba(237, 28, 36, .38); outline-offset: 3px; }

.hero { position: relative; min-height: 532px; color: #fff; background: linear-gradient(90deg, rgba(1, 16, 28, .86) 0%, rgba(2, 25, 40, .62) 38%, rgba(3, 25, 38, .2) 72%), url("../img/hero-city.png") center 48% / cover no-repeat; }
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(1, 13, 22, .18), transparent 45%, rgba(2, 13, 20, .26)); }
.nav { position: relative; z-index: 5; height: 76px; display: flex; align-items: center; gap: clamp(26px, 4.4vw, 74px); }
.brand { color: var(--primary); font-size: clamp(28px, 2.1vw, 38px); line-height: 1; font-weight: 800; letter-spacing: -2px; }
.nav-links { display: flex; align-items: center; gap: clamp(23px, 2.6vw, 46px); flex: 1; }
.nav-links a { color: #fff; font-size: 14px; font-weight: 600; opacity: .96; transition: color .2s ease, opacity .2s ease; white-space: nowrap; }
.nav-links a:hover { color: #ff6469; opacity: 1; }
.nav-actions { display: flex; align-items: center; gap: 17px; }
.icon-button, .login-button, .menu-button { border: 0; background: transparent; color: #fff; min-width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.icon-button svg { width: 23px; height: 23px; }
.login-button { gap: 8px; font-size: 14px; font-weight: 600; padding: 0 2px; }
.login-button svg { width: 21px; }
.publish-button { border: 0; border-radius: 7px; height: 42px; padding: 0 20px; background: var(--primary); color: #fff; font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; transition: background .2s ease, transform .2s ease; }
.publish-button:hover { background: #ff3239; transform: translateY(-1px); }
.menu-button { display: none; flex-direction: column; gap: 5px; }
.menu-button span { width: 22px; height: 2px; background: currentColor; transition: transform .2s ease, opacity .2s ease; }

.hero-copy { position: relative; z-index: 2; padding-top: 72px; padding-left: clamp(0px, 10.7vw, 204px); }
.hero-copy h1 { margin: 0 0 4px; font-size: clamp(27px, 2.5vw, 42px); line-height: 1.2; letter-spacing: -1.25px; font-weight: 700; text-shadow: 0 2px 18px rgba(0,0,0,.32); }
.hero-copy p { margin: 0; font-size: clamp(15px, 1.3vw, 21px); font-weight: 600; text-shadow: 0 2px 14px rgba(0,0,0,.42); }
.search-shell { position: absolute; z-index: 5; left: 50%; bottom: 18px; transform: translateX(-50%); padding-inline: clamp(0px, 2vw, 30px); }
.search-panel { overflow: visible; padding: 16px 18px 14px; color: var(--ink); background: rgba(255, 255, 255, .99); border: 1px solid rgba(227,230,232,.9); border-radius: 15px; box-shadow: 0 18px 46px rgba(0, 10, 20, .25); }
.home-filter-row { display: grid; grid-template-columns: minmax(104px,.72fr) minmax(132px,.9fr) minmax(116px,.76fr) minmax(145px,.95fr) minmax(235px,1.65fr) auto auto; gap: 9px; }
.search-control { min-width: 0; height: 58px; display: flex; align-items: center; position: relative; border: 1px solid #dfe3e6; border-radius: 10px; background: #fff; transition: border-color .2s ease, box-shadow .2s ease; }
.search-control:focus-within { border-color: #ef7277; box-shadow: 0 0 0 3px rgba(237,28,36,.09); }
.search-control input, .search-control select { min-width: 0; width: 100%; height: 100%; border: 0; outline: 0; appearance: none; background: transparent; color: #242b31; padding: 0 38px 0 14px; font-size: 14px; font-weight: 600; }
.search-control > svg:not(.leading-icon) { position: absolute; right: 12px; width: 18px; height: 18px; color: #525b62; pointer-events: none; }
.search-location input { padding-left: 42px; padding-right: 82px; font-weight: 500; }
.search-location .leading-icon { position: absolute; left: 13px; width: 19px; height: 19px; color: #717a81; pointer-events: none; }
.city-suffix { position: absolute; right: 13px; color: var(--primary); font-size: 12px; font-weight: 700; pointer-events: none; }
.filter-open-button, .search-button { min-height: 58px; border-radius: 10px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; font-size: 14px; font-weight: 700; transition: background .2s ease, border-color .2s ease, color .2s ease; }
.filter-open-button { border: 1px solid #dfe3e6; background: #fff; color: #282f35; }
.filter-open-button:hover { border-color: #ee9a9e; color: var(--primary); background: #fff8f8; }
.filter-open-button svg { width: 21px; height: 21px; }
.search-button { border: 0; background: var(--primary); color: #fff; }
.search-button:hover { background: var(--primary-dark); }
.property-chip-row { min-height: 52px; padding-top: 13px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.property-chips { display: flex; gap: 8px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.property-chips::-webkit-scrollbar { display: none; }
.property-chip { min-height: 38px; flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; border: 1px solid transparent; border-radius: 999px; padding: 0 14px; background: #f5f6f7; color: #353c42; font-size: 12px; font-weight: 600; transition: color .2s ease, border-color .2s ease, background .2s ease; }
.property-chip svg { width: 19px; height: 19px; }
.property-chip:hover, .property-chip.active { border-color: #efb3b6; background: #fff5f5; color: var(--primary); }
.today-listings { flex: 0 0 auto; color: #343b41; border-bottom: 1px solid currentColor; font-size: 12px; font-weight: 700; }
.search-tags a { border: 1px solid var(--line); border-radius: 6px; background: #fafbfb; min-height: 34px; padding: 0 18px; color: #4c545b; font-size: 12px; }
.search-tags a:hover { border-color: #ffc4c7; color: var(--primary); background: #fff8f8; }

main { background: #fff; }
.content-section { position: relative; padding: 20px 0 22px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; min-height: 42px; }
.section-heading h2, .discovery h2 { margin: 0; font-size: 18px; line-height: 1.25; letter-spacing: -.35px; }
.section-heading a { color: var(--primary); font-size: 12px; font-weight: 600; }
.section-heading a span { margin-left: 8px; font-size: 18px; }
.card-rail { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; overflow: hidden; scroll-behavior: smooth; }
.property-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; transition: transform .2s ease, box-shadow .2s ease; }
.property-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-media { position: relative; height: clamp(132px, 11.8vw, 205px); background-size: cover; background-position: center; }
.image-apartment { background-image: url("../img/property-apartment.png"); }
.image-villa { background-image: url("../img/property-villa.png"); }
.image-office { background-image: url("../img/property-office.png"); }
.pos-a { background-position: 45% 50%; }
.pos-b { background-position: 20% 52%; }
.pos-c { background-position: 76% 50%; }
.pos-d { background-position: 58% 50%; }
.pos-e { background-position: 88% 50%; }
.filtered-cool { filter: saturate(.86) hue-rotate(-9deg) brightness(1.03); }
.filtered-warm { filter: saturate(.92) sepia(.08) brightness(.98); }
.filtered-blue { filter: saturate(.74) hue-rotate(7deg) contrast(1.02); }
.status { position: absolute; top: 9px; left: 9px; min-height: 22px; display: inline-flex; align-items: center; border-radius: 4px; padding: 0 8px; color: #fff; font-size: 9px; font-weight: 700; z-index: 1; }
.status.red { background: var(--primary); }
.status.yellow, .status.premium { background: #ffb400; }
.status.green { background: #16965b; }
.heart { position: absolute; top: 5px; right: 7px; width: 36px; height: 36px; border: 0; background: transparent; color: #fff; font-family: Arial, sans-serif; font-size: 29px; line-height: 1; text-shadow: 0 1px 7px rgba(0,0,0,.65); z-index: 2; }
.heart.saved { color: var(--primary); text-shadow: 0 1px 4px rgba(255,255,255,.9); }
.card-body { padding: 10px 12px 11px; }
.card-body h3 { margin: 0 0 6px; font-size: 14px; line-height: 1.35; }
.card-body p { margin: 0 0 5px; color: var(--muted); font-size: 12px; }
.price { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 7px; }
.price b { font-size: 13px; }
.price span { color: var(--muted); font-size: 10px; white-space: nowrap; }
.rail-next { position: absolute; z-index: 4; right: -18px; top: 50%; transform: translateY(-6%); width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: #333; font-size: 29px; line-height: 1; box-shadow: 0 4px 13px rgba(0,0,0,.11); transition: transform .2s, color .2s; }
.rail-next:hover { color: var(--primary); transform: translateY(-6%) scale(1.06); }


.agency-rail { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; overflow: hidden; scroll-behavior: smooth; }
.agency-card { height: 124px; border: 1px solid var(--line); border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #fff; transition: transform .2s, box-shadow .2s; }
.agency-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.agency-card h3 { margin: 7px 0 2px; font-size: 12px; }
.agency-card p { margin: 0; color: var(--muted); font-size: 10px; }
.agency-logo { position: relative; width: 72px; height: 45px; display: grid; place-items: center; font-weight: 800; }
.agency-logo.gold { color: #f0a900; font-size: 30px; border-bottom: 5px solid #f0a900; transform: skew(-7deg); }
.agency-logo.city span { color: #0757c5; font-size: 40px; font-style: italic; text-shadow: 8px 3px 0 #032d83; }
.agency-logo.leader { width: 105px; font-size: 21px; letter-spacing: -2px; color: #1a1a1a; }
.agency-logo.leader span::first-letter { color: #bd7c39; }
.agency-logo.newlife { color: #0778e7; font-size: 22px; border: 4px solid #0778e7; clip-path: polygon(50% 0,100% 34%,92% 100%,8% 100%,0 34%); }
.agency-logo.vostok span { font-size: 34px; color: #171b1f; transform: rotate(-12deg); }
.agency-logo.domus { color: #18314d; border-bottom: 3px solid #18314d; }
.agency-logo.domus span { font-size: 29px; }
.agency-logo.domus small { position: absolute; bottom: -1px; right: 2px; font-size: 7px; background: #fff; }

.discovery { display: grid; grid-template-columns: 42% 58%; gap: 50px; padding: 0 0 28px; }
.discovery h2 { margin-bottom: 10px; }
.search-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.search-tags a { min-height: 29px; display: inline-flex; align-items: center; padding-inline: 13px; }
.region-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px 24px; }
.region-grid a { color: #30363a; font-size: 11px; }
.region-grid a:hover { color: var(--primary); }

.footer { border-top: 1px solid var(--line); background: #fff; padding: 25px 0 12px; }
.footer-grid { display: grid; grid-template-columns: 1.3fr .95fr 1.45fr 1.2fr .8fr; gap: clamp(28px, 4vw, 74px); }
.footer .brand { display: inline-block; margin-bottom: 7px; }
.footer h3 { margin: 0 0 11px; font-size: 15px; }
.footer p, .footer a:not(.brand):not(.store-badge) { display: block; margin: 0 0 8px; color: #4f565b; font-size: 13px; line-height: 1.55; }
.footer a:hover { color: var(--primary); }
.footer-brand > p { max-width: 260px; }
.socials { display: flex; gap: 10px; margin-top: 16px; }
.socials a { width: 36px; height: 36px; display: grid !important; place-items: center; border-radius: 50%; background: #191d20; color: #fff !important; transition: background .2s ease, transform .2s ease; }
.socials a:hover { background: var(--primary); transform: translateY(-2px); }
.socials svg { width: 19px; height: 19px; fill: currentColor; stroke: none; }
.socials svg rect, .socials svg circle { fill: none; stroke: currentColor; stroke-width: 1.9; }
.socials .fill-dot { fill: currentColor; stroke: none; }
.socials .play-mark { fill: #191d20; }
.socials a:hover .play-mark { fill: var(--primary); }
.store-badge { width: 154px; height: 48px; position: relative; display: grid; grid-template-columns: 38px 1fr; grid-template-rows: 18px 21px; align-items: center; border: 1px solid #c8cdd1; border-radius: 8px; padding: 4px 9px; margin-bottom: 9px; background: #fff; transition: border-color .2s ease, box-shadow .2s ease; }
.store-badge:hover { border-color: #899198; box-shadow: 0 5px 14px rgba(14,24,33,.09); }
.store-icon { grid-row: 1/3; width: 28px; height: 28px; }
.apple-icon { fill: #111; stroke: none; }
.google-play-icon { stroke: none; }
.store-badge small { align-self: end; color: #555; font-size: 8px; line-height: 1; }
.store-badge b { align-self: start; color: #161a1d; font-size: 14px; line-height: 1.2; }
.footer-bottom { border-top: 1px solid #eef0f1; margin-top: 18px; padding-top: 12px; display: flex; align-items: center; justify-content: space-between; }
.footer-bottom p { margin: 0; color: #676e74; font-size: 12px; }
.payments { display: flex; align-items: center; gap: 20px; color: #1645ae; font-size: 11px; font-style: italic; }
.payments b:first-child { color: #23a8ad; }
.payments .master { color: #e22c25; letter-spacing: -6px; font-style: normal; }

.toast { position: fixed; z-index: 100; left: 50%; bottom: 24px; transform: translate(-50%, 120px); opacity: 0; min-width: 250px; padding: 12px 17px; border-radius: 8px; background: #17232b; color: #fff; text-align: center; font-size: 13px; box-shadow: 0 12px 30px rgba(0,0,0,.22); transition: transform .25s ease, opacity .25s ease; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 1180px) {
  .nav { gap: 28px; }
  .nav-links { gap: 22px; }
  .search-shell { padding-inline: 0; }
  .home-filter-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .search-location { grid-column: span 2; }
  .hero { min-height: 635px; }
  .card-rail { grid-template-columns: repeat(5, minmax(220px, 1fr)); overflow-x: auto; scrollbar-width: none; scroll-snap-type: x mandatory; }
  .card-rail::-webkit-scrollbar, .agency-rail::-webkit-scrollbar { display: none; }
  .property-card { scroll-snap-align: start; }
  .card-media { height: 158px; }
  .agency-rail { grid-template-columns: repeat(6, minmax(180px, 1fr)); overflow-x: auto; scroll-snap-type: x mandatory; }
}

@media (max-width: 940px) {
  .nav-links { position: absolute; top: 70px; left: 0; right: 0; display: none; padding: 15px; flex-direction: column; align-items: stretch; gap: 0; border-radius: 10px; background: rgba(4, 24, 36, .97); box-shadow: var(--shadow); }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 13px 12px; border-bottom: 1px solid rgba(255,255,255,.08); }
  .menu-button { display: inline-flex; }
  .hero-copy { padding-left: 0; }
  .hero { min-height: 660px; }
  .home-filter-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .search-location { grid-column: span 2; }
  .property-chip-row { align-items: flex-start; }
  .today-listings { padding-top: 10px; }
  .discovery { grid-template-columns: 1fr; gap: 25px; }
  .footer-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 720px) {
  :root { --page: calc(100% - 28px); }
  body { font-size: 14px; }
  .hero { min-height: auto; padding-bottom: 14px; background-position: 58% center; }
  .nav { height: 68px; }
  .brand { font-size: 29px; }
  .icon-button, .login-button span { display: none; }
  .login-button { min-width: 38px; }
  .publish-button { display: none; }
  .hero-copy { padding-top: 54px; }
  .hero-copy h1 { max-width: 340px; font-size: 29px; }
  .hero-copy p { max-width: 310px; margin-top: 7px; font-size: 15px; }
  .search-shell { position: relative; left: auto; bottom: auto; transform: none; margin-top: 44px; }
  .search-panel { padding: 12px; border-radius: 12px; }
  .home-filter-row { grid-template-columns: 1fr 1fr; }
  .search-location { grid-column: 1 / -1; }
  .filter-open-button, .search-button { min-height: 52px; }
  .property-chip-row { display: block; }
  .property-chips { padding-top: 10px; }
  .today-listings { display: inline-block; margin: 12px 2px 2px; padding-top: 0; }
  .content-section { padding-bottom: 17px; }
  .section-heading h2, .discovery h2 { font-size: 16px; }
  .section-heading a { font-size: 10px; }
  .card-rail { grid-template-columns: repeat(5, minmax(245px, 78vw)); }
  .card-media { height: 160px; }
  .rail-next { display: none; }
  .discovery { padding-top: 5px; }
  .region-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 26px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-bottom { align-items: flex-start; gap: 13px; flex-direction: column; }
  .payments { flex-wrap: wrap; gap: 13px; }
}

@media (max-width: 440px) {
  .hero-copy { padding-top: 42px; }
  .home-filter-row { grid-template-columns: 1fr; }
  .search-location { grid-column: auto; }
  .search-price { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-brand { grid-column: auto; }
  .app-column { display: flex; flex-wrap: wrap; gap: 8px; }
  .app-column h3 { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
