:root {
  color-scheme: light;
  --paper: #f8f2e7;
  --paper-2: #f1e7d6;
  --card: #fffaf2;
  --ink: #2a241d;
  --ink-2: #5d5346;
  --muted: #8a7d6b;
  --line: #e2d5bf;
  --terracotta: #b5562e;
  --sage: #2f7d5b;
  --gold: #c99a3b;
  --night: #1d2a2a;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Manrope", system-ui, -apple-system, sans-serif;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 8px 30px rgba(60, 40, 20, .10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.65 var(--sans); }
img { max-width: 100%; display: block; }
a { color: var(--terracotta); }

/* ---------- bilingual ---------- */
html[lang="en"] .ru, html[lang="ru"] .en { display: none !important; }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 1000; display: flex; align-items: center; gap: 24px;
  padding: 14px 28px; color: #fff; transition: background .3s, color .3s, box-shadow .3s;
}
.nav.solid { background: rgba(248, 242, 231, .94); color: var(--ink); backdrop-filter: blur(8px); box-shadow: 0 1px 0 var(--line); }
.nav .logo { font: 600 24px/1 var(--serif); letter-spacing: .5px; color: inherit; text-decoration: none; }
.nav .links { display: flex; gap: 20px; margin-left: auto; font-size: 14px; }
.nav .links a { color: inherit; text-decoration: none; opacity: .85; }
.nav .links a:hover, .nav .links a.active { opacity: 1; text-decoration: underline; text-underline-offset: 5px; }
.lang { display: flex; border: 1px solid currentColor; border-radius: 99px; overflow: hidden; font-size: 13px; }
.lang button { background: none; border: 0; color: inherit; padding: 4px 11px; cursor: pointer; font: inherit; }
.lang button.on { background: currentColor; }
.lang button.on span { color: var(--paper); mix-blend-mode: normal; }
.nav:not(.solid) .lang button.on span { color: #222; }
@media (max-width: 760px) { .nav .links { display: none; } .nav .lang { margin-left: auto; } }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 100vh; display: grid; place-items: end start; color: #fff; overflow: hidden; }
.hero .bg { position: absolute; inset: 0; background-size: cover; background-position: center; transform: scale(1.06); animation: drift 30s ease-in-out infinite alternate; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.25) 0%, rgba(0,0,0,0) 35%, rgba(20,15,10,.75) 100%); }
@keyframes drift { to { transform: scale(1.14) translate(-1.5%, -1%); } }
.hero .inner { position: relative; z-index: 2; padding: 0 6vw 12vh; max-width: 980px; }
.hero .kicker { font: 500 13px/1 var(--sans); letter-spacing: 3px; text-transform: uppercase; opacity: .9; }
.hero h1 { font: 500 clamp(44px, 7vw, 96px)/1.02 var(--serif); margin: 18px 0 22px; text-shadow: 0 2px 30px rgba(0,0,0,.3); }
.hero h1 em { color: #ffd9a0; }
.hero p { font-size: clamp(17px, 1.6vw, 21px); max-width: 660px; opacity: .95; }
.hero .caption { position: absolute; z-index: 2; right: 24px; bottom: 18px; font-size: 12px; opacity: .75; color: #ffe27a; }
.hero .scroll { display: inline-block; margin-top: 26px; color: #fff; text-decoration: none; border: 1px solid rgba(255,255,255,.6); border-radius: 99px; padding: 10px 22px; font-size: 14px; }
.hero .scroll:hover { background: rgba(255,255,255,.15); }

/* ---------- sections ---------- */
section { padding: 96px 6vw; }
.wrap { max-width: 1180px; margin: 0 auto; }
.eyebrow { font: 600 12px/1 var(--sans); letter-spacing: 3px; text-transform: uppercase; color: var(--terracotta); }
h2 { font: 500 clamp(34px, 4.4vw, 58px)/1.08 var(--serif); margin: 14px 0 22px; }
h3 { font: 600 26px/1.2 var(--serif); margin: 0 0 8px; }
.lead { font-size: 20px; color: var(--ink-2); max-width: 760px; }
.dropcap::first-letter { float: left; font: 600 74px/.8 var(--serif); padding: 8px 10px 0 0; color: var(--terracotta); }
.alt { background: var(--paper-2); }
.dark { background: var(--night); color: #efe7d8; }
.dark .lead { color: #cfc5b3; }
.dark .eyebrow { color: var(--gold); }

/* ---------- story columns ---------- */
.story { display: grid; grid-template-columns: 1.05fr 1fr; gap: 64px; align-items: center; }
.story.rev { grid-template-columns: 1fr 1.05fr; }
.story.rev .ph { order: 2; }
.story .ph { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 4/3; }
.story .ph img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 900px) { .story, .story.rev { grid-template-columns: 1fr; gap: 28px; } .story.rev .ph { order: 0; } }

.day { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 40px; }
.day div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.day b { display: block; font: 600 30px/1 var(--serif); color: var(--terracotta); margin-bottom: 8px; }
@media (max-width: 900px) { .day { grid-template-columns: 1fr 1fr; } }

/* ---------- mosaic gallery ---------- */
.mosaic { columns: 4 260px; column-gap: 12px; margin-top: 36px; }
.mosaic figure { margin: 0 0 12px; break-inside: avoid; position: relative; border-radius: 10px; overflow: hidden; cursor: zoom-in; }
.mosaic img { width: 100%; transition: transform .6s; }
.mosaic figure:hover img { transform: scale(1.05); }
.mosaic figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 12px 10px; color: #ffe27a; font-size: 13px; background: linear-gradient(transparent, rgba(0,0,0,.6)); }

/* ---------- listing cards (style of the reference screenshot) ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 26px; margin-top: 40px; }
.card { background: #fff; border-radius: 6px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 10px 26px rgba(60,40,20,.08); display: flex; flex-direction: column; transition: transform .25s, box-shadow .25s; }
.card:hover { transform: translateY(-4px); box-shadow: 0 2px 6px rgba(0,0,0,.12), 0 18px 40px rgba(60,40,20,.16); }
.card .slides { position: relative; aspect-ratio: 16/11; background: #ddd; overflow: hidden; }
.card .slides img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s; }
.card .slides img.on { opacity: 1; }
.card .badge { position: absolute; top: 12px; left: 12px; z-index: 2; background: #3f7a14; color: #fff; font: 700 11px/1 var(--sans); letter-spacing: 1.5px; padding: 6px 8px; border-radius: 3px; }
.card .badge.lease { background: #8a5a12; }
.card .badge.insp { background: #6b4fa0; }
.card .heart { position: absolute; top: 10px; right: 12px; z-index: 2; color: #fff; font-size: 22px; text-shadow: 0 1px 6px rgba(0,0,0,.4); cursor: pointer; user-select: none; }
.card .heart.on { color: #e5484d; }
.card .arrow { position: absolute; top: 50%; z-index: 2; width: 30px; height: 30px; margin-top: -15px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); cursor: pointer; font-size: 15px; color: #222; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.card .arrow.l { left: 10px; } .card .arrow.r { right: 10px; }
.card .dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; z-index: 2; }
.card .dots i { width: 22px; height: 2px; background: rgba(255,255,255,.55); }
.card .dots i.on { background: #fff; }
.card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card .loc { font-size: 14px; color: #555; }
.card .title { font: 600 21px/1.25 var(--serif); color: #1d1d1d; }
.card .text { font-size: 14.5px; color: #4a4a4a; margin: 6px 0 8px; }
.card .plabel { font-size: 13px; color: #777; margin-top: auto; }
.card .price { font: 600 24px/1.2 var(--sans); color: #1d1d1d; }
.card .meta { font-size: 13px; color: #666; }
.card .tomap { font-size: 13px; margin-top: 6px; cursor: pointer; color: var(--terracotta); background: none; border: 0; padding: 0; text-align: left; font-family: inherit; }
.card.ref { outline: 2px solid #c9302c; }
.card.ref .price { color: #c9302c; }

/* ---------- comparison ---------- */
.versus { display: grid; grid-template-columns: 1fr auto 1fr; gap: 28px; align-items: stretch; margin-top: 40px; }
.versus .vs { align-self: center; font: italic 500 40px/1 var(--serif); color: var(--muted); }
@media (max-width: 900px) { .versus { grid-template-columns: 1fr; } .versus .vs { justify-self: center; } }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-top: 18px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.tile .k { font-size: 12.5px; color: var(--ink-2); letter-spacing: .3px; }
.tile .v { font: 600 26px/1.15 var(--sans); color: var(--ink); margin-top: 6px; font-variant-numeric: tabular-nums; }
.tile .s { font-size: 12.5px; color: var(--muted); }

.calc { display: grid; grid-template-columns: 340px 1fr; gap: 36px; margin-top: 44px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 30px; box-shadow: var(--shadow); }
@media (max-width: 960px) { .calc { grid-template-columns: 1fr; } }
.ctrl { margin-bottom: 18px; }
.ctrl label { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-2); }
.ctrl label b { color: var(--ink); font-variant-numeric: tabular-nums; }
.ctrl input[type=range] { width: 100%; accent-color: var(--terracotta); }
.ctrl .hint, .ctrl.hint { font-size: 12px; color: var(--muted); }

/* chart */
.viz-root { --surface-1: #fffaf2; --text-primary: #2a241d; --text-secondary: #5d5346; --grid: #ebe1cf; --series-1: #2f7d5b; --ref: #8a7d6b; position: relative; }
.viz-root svg { width: 100%; height: auto; display: block; overflow: visible; }
.viz-root .axis text { fill: var(--text-secondary); font: 12px var(--sans); }
.viz-root .tip { position: absolute; pointer-events: none; background: #2a241d; color: #fff; font-size: 13px; padding: 8px 10px; border-radius: 8px; white-space: nowrap; opacity: 0; transition: opacity .12s; box-shadow: var(--shadow); }
.viz-root .tip b { font-variant-numeric: tabular-nums; }
.viz-title { font: 600 15px/1.3 var(--sans); margin: 0 0 2px; }
.viz-sub { font-size: 13px; color: var(--ink-2); margin: 0 0 12px; }
details.table { margin-top: 10px; font-size: 13px; }
details.table table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
details.table td, details.table th { border-bottom: 1px solid var(--line); padding: 4px 8px; text-align: right; }

/* ---------- map ---------- */
.map { height: 640px; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); margin-top: 36px; border: 1px solid var(--line); }
.map.tall { height: 78vh; }
.pin { width: 54px; height: 54px; border-radius: 50%; border: 3px solid #fff; background-size: cover; background-position: center; box-shadow: 0 3px 12px rgba(0,0,0,.35); transition: transform .2s; }
.pin:hover { transform: scale(1.18); }
.pin.insp { border-color: #ffe27a; }
.leaflet-popup-content-wrapper { border-radius: 12px !important; padding: 0 !important; overflow: hidden; }
.leaflet-popup-content { margin: 0 !important; width: 280px !important; font-family: var(--sans); }
.pop img { width: 100%; height: 170px; object-fit: cover; }
.pop div { padding: 12px 14px 14px; }
.pop h4 { font: 600 19px/1.2 var(--serif); margin: 0 0 4px; }
.pop p { margin: 0 0 6px !important; font-size: 13px; color: #555; }
.pop .pr { font-weight: 700; font-size: 15px; color: #1d1d1d; }
.legend-row { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 14px; font-size: 13px; color: var(--ink-2); }
.legend-row > span::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; border: 2px solid #fff; box-shadow: 0 0 0 1px #aaa; background: #c9b79a; }
.legend-row > .y::before { box-shadow: 0 0 0 1px #c9a500; background: #ffe27a; }
.legend-row > .z::before { background: rgba(240,168,48,.5); box-shadow: 0 0 0 1px var(--terracotta); border-radius: 3px; }

/* ---------- LLM verdict ---------- */
.verdict { max-width: 900px; margin: 40px auto 0; }
.chat { display: flex; gap: 16px; margin-bottom: 22px; }
.chat .av { flex: 0 0 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; background: linear-gradient(135deg, #d97757, #c99a3b); color: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.chat .bubble { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: 4px 18px 18px 18px; padding: 22px 26px; }
.chat .bubble p { margin: 0 0 12px; }
.chat .bubble p:last-child { margin: 0; }
.chat .who { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; }
.score { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 32px; margin: 18px 0 6px; }
@media (max-width: 700px) { .score { grid-template-columns: 1fr; } }
.score .row { font-size: 14px; }
.score .row div:first-child { display: flex; justify-content: space-between; }
.score .bar { height: 6px; background: rgba(255,255,255,.12); border-radius: 99px; margin-top: 6px; overflow: hidden; }
.score .bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #c99a3b, #ffd9a0); }
.typing::after { content: "▍"; animation: blink 1s steps(1) infinite; color: var(--gold); }
@keyframes blink { 50% { opacity: 0; } }

.pros, .cons { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 26px; }
.pros div, .cons div { border-radius: 14px; padding: 20px 22px; }
.pros div { background: rgba(255,217,160,.08); border: 1px solid rgba(255,217,160,.25); }
.cons div { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--terracotta); }
.pros h4, .cons h4 { margin: 0 0 6px; font: 600 20px/1.2 var(--serif); }
.cons p, .pros p { margin: 0; font-size: 15px; }
.cons p { color: var(--ink-2); }
.cons .sev { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--terracotta); font-weight: 700; }

/* ---------- quote / footer ---------- */
.quote { font: italic 500 clamp(26px, 3.2vw, 40px)/1.3 var(--serif); text-align: center; max-width: 900px; margin: 0 auto; }
.quote small { display: block; margin-top: 14px; font: 13px var(--sans); letter-spacing: 2px; text-transform: uppercase; color: var(--muted); font-style: normal; }
footer { padding: 50px 6vw; background: #161f1f; color: #a99f8e; font-size: 12.5px; }
footer a { color: #d9c9a8; }
footer .credits { columns: 3 280px; column-gap: 30px; margin-top: 14px; }
footer .credits div { break-inside: avoid; margin-bottom: 4px; }

/* lightbox */
.lb { position: fixed; inset: 0; z-index: 3000; background: rgba(10,8,6,.92); display: none; place-items: center; padding: 30px; cursor: zoom-out; }
.lb.on { display: grid; }
.lb img { max-height: 86vh; max-width: 92vw; border-radius: 6px; box-shadow: 0 10px 50px rgba(0,0,0,.6); }
.lb p { color: #ffe27a; text-align: center; margin-top: 12px; font-size: 14px; }

.reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s, transform .9s; }
.reveal.in { opacity: 1; transform: none; }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.filters button { border: 1px solid var(--line); background: var(--card); color: var(--ink-2); border-radius: 99px; padding: 7px 14px; font: 500 13.5px var(--sans); cursor: pointer; }
.filters button.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.ranklist { counter-reset: r; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 26px; margin-top: 22px; padding: 0; list-style: none; }
.ranklist li { padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.ranklist li b { font: 600 22px var(--serif); color: var(--terracotta); margin-right: 8px; }

/* polaroid inset in hero (user's reference photo) */
.polaroid { position: absolute; z-index: 2; right: 7vw; top: 50%; transform: translateY(-50%) rotate(3deg); width: min(300px, 24vw); margin: 0; background: #fbf8f2; padding: 12px 12px 0; box-shadow: 0 20px 60px rgba(0,0,0,.45); cursor: zoom-in; transition: transform .4s; }
.polaroid:hover { transform: translateY(-50%) rotate(0deg) scale(1.03); }
.polaroid img { width: 100%; aspect-ratio: 746 / 800; object-fit: cover; object-position: top; }
.polaroid figcaption { font: italic 500 20px/1 var(--serif); color: #3a3128; text-align: center; padding: 14px 0 16px; }
@media (max-width: 900px) { .polaroid { display: none; } }

.cons { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .cons { grid-template-columns: 1fr; } }
