/* Empire Residence — Apple-inspired design system with light and dark themes.
   Palette: Gold #C08E3F · Ink #1C1C1C · Bronze #A67832 · Ivory #FDFBF7, plus derived tints and shades.
   Type: SF Pro Display (assets/fonts/sf-pro-display). Theme: html[data-theme="light" | "dark"]. */

/* ── SF Pro Display ─────────────────────────────────────────────────────── */
@font-face { font-family: "SF Pro Display"; font-weight: 100; font-style: normal; font-display: swap;
  src: url("../fonts/sf-pro-display/SF-Pro-Display-Ultralight.woff2") format("woff2"); }
@font-face { font-family: "SF Pro Display"; font-weight: 200; font-style: normal; font-display: swap;
  src: url("../fonts/sf-pro-display/SF-Pro-Display-Thin.woff2") format("woff2"); }
@font-face { font-family: "SF Pro Display"; font-weight: 300; font-style: normal; font-display: swap;
  src: url("../fonts/sf-pro-display/SF-Pro-Display-Light.woff2") format("woff2"); }
@font-face { font-family: "SF Pro Display"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../fonts/sf-pro-display/SF-Pro-Display-Regular.woff2") format("woff2"); }
@font-face { font-family: "SF Pro Display"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("../fonts/sf-pro-display/SF-Pro-Display-Medium.woff2") format("woff2"); }
@font-face { font-family: "SF Pro Display"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("../fonts/sf-pro-display/SF-Pro-Display-Semibold.woff2") format("woff2"); }
@font-face { font-family: "SF Pro Display"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("../fonts/sf-pro-display/SF-Pro-Display-Bold.woff2") format("woff2"); }
@font-face { font-family: "SF Pro Display"; font-weight: 800; font-style: normal; font-display: swap;
  src: url("../fonts/sf-pro-display/SF-Pro-Display-Heavy.woff2") format("woff2"); }
@font-face { font-family: "SF Pro Display"; font-weight: 900; font-style: normal; font-display: swap;
  src: url("../fonts/sf-pro-display/SF-Pro-Display-Black.woff2") format("woff2"); }

/* ── Tokens: light (default) ────────────────────────────────────────────── */
:root {
  color-scheme: light;

  /* Brand palette */
  --gold: #C08E3F;
  --ink: #1C1C1C;
  --bronze: #A67832;
  --ivory: #FDFBF7;

  --bg: #FDFBF7;               /* ivory */
  --surface: #F7F1E6;          /* ivory shaded toward gold */
  --surface-2: #EEE5D4;
  --text: #1C1C1C;             /* ink */
  --text-2: #5E574C;           /* warm grey, 6.6:1 on ivory */
  --accent: #1C1C1C;           /* primary buttons: ink */
  --on-accent: #FDFBF7;
  --accent-hover: #C08E3F;     /* …turning gold on hover */
  --on-accent-hover: #1C1C1C;
  --accent-text: #80592A;      /* gold deepened for small text: AA (4.5:1+) on every light surface */
  --display-accent: #A67832;   /* bronze for large display type */
  --accent-tint: #F2E6CF;      /* gold tint for badges and chips */
  --tile: #1C1C1C;             /* feature tile: ink */
  --on-tile: #FDFBF7;
  --on-tile-2: rgba(253, 251, 247, .72);
  --line: rgba(28, 28, 28, .10);
  --line-strong: rgba(28, 28, 28, .18);
  --nav-bg: rgba(253, 251, 247, .8);
  --backdrop: rgba(28, 28, 28, .45);
  --ring: rgba(192, 142, 63, .28);
  --pattern: rgba(166, 120, 50, .16);  /* bronze, for the faint background motifs */
  --pattern-strong: rgba(166, 120, 50, .24);
  --shadow-sm: 0 1px 2px rgba(28, 28, 28, .06), 0 1px 1px rgba(28, 28, 28, .04);
  --shadow-md: 0 8px 28px rgba(60, 44, 18, .10);
  --shadow-lg: 0 24px 64px rgba(28, 28, 28, .2);
  --img-dim: none;
  --swatch-1: #1C1C1C; --swatch-2: #4A3F2E; --swatch-3: #A67832; --swatch-4: #C08E3F; --swatch-5: #E2CB9F; --swatch-6: #F2E6CF;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2380592A' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

  --font: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Shape and spacing scale */
  --r-xs: 8px;
  --r-sm: 12px;
  --r: 18px;
  --r-lg: 28px;
  --pill: 980px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-14: 56px; --s-20: 80px;

  --container: 1200px;
  --gutter: clamp(20px, 5vw, 64px);
  --section-y: clamp(64px, 9vw, 128px);
  --nav-h: 64px;
  --ease: cubic-bezier(.25, .1, .25, 1);
}

/* ── Tokens: dark ───────────────────────────────────────────────────────── */
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #141312;               /* ink, one shade deeper */
  --surface: #1C1C1C;          /* ink */
  --surface-2: #27251F;
  --text: #FDFBF7;             /* ivory */
  --text-2: #B3AA9A;           /* warm grey, 8:1 on bg */
  --accent: #C08E3F;           /* primary buttons: gold */
  --on-accent: #1C1C1C;
  --accent-hover: #D3A65E;
  --on-accent-hover: #1C1C1C;
  --accent-text: #D0A35A;      /* gold lifted for text, 7.6:1 on bg */
  --display-accent: #C08E3F;
  --accent-tint: #2E2719;
  --tile: #2A2419;             /* deep bronze shade */
  --on-tile: #FDFBF7;
  --on-tile-2: rgba(253, 251, 247, .72);
  --line: rgba(253, 251, 247, .10);
  --line-strong: rgba(253, 251, 247, .2);
  --nav-bg: rgba(20, 19, 18, .76);
  --backdrop: rgba(0, 0, 0, .62);
  --ring: rgba(192, 142, 63, .32);
  --pattern: rgba(192, 142, 63, .13);
  --pattern-strong: rgba(192, 142, 63, .2);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, .45);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, .6);
  --img-dim: brightness(.92);
  --swatch-1: #FDFBF7; --swatch-2: #F2E6CF; --swatch-3: #E2CB9F; --swatch-4: #C08E3F; --swatch-5: #A67832; --swatch-6: #4A3F2E;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23D0A35A' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Smooth cross-fade while the theme switches (class is added briefly by the toggle) */
html.theme-anim, html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after {
  transition: background-color .35s var(--ease), color .35s var(--ease), border-color .35s var(--ease), fill .35s var(--ease) !important;
}

/* ── Base ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 17px; line-height: 1.5; font-weight: 400; letter-spacing: -.003em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-wrap: pretty; overflow-x: clip;
}
h1, h2, h3, h4 { font-family: var(--font); margin: 0; color: inherit; text-wrap: balance; overflow-wrap: break-word; hyphens: auto; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
figure { margin: 0; }
button, input, select { font: inherit; letter-spacing: inherit; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
::selection { background: var(--gold); color: var(--ink); }
section[id] { scroll-margin-top: calc(var(--nav-h) + 12px); }

/* ── Layout ─────────────────────────────────────────────────────────────── */
.container { max-width: calc(var(--container) + var(--gutter) * 2); margin: 0 auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-y); --card: var(--surface); }
.section--alt { background: var(--surface); --card: var(--bg); }
.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(36px, 6vw, 80px); align-items: center; }
.split > .frame { width: 100%; aspect-ratio: 4 / 5; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s-6) var(--s-14); flex-wrap: wrap; margin-bottom: clamp(36px, 4.5vw, 56px); }
.section-head .lead { max-width: 40ch; }
.stack-lg { margin-top: var(--s-10); }

/* ── Type ───────────────────────────────────────────────────────────────── */
.eyebrow { display: block; margin-bottom: var(--s-3); font-size: 17px; font-weight: 600; letter-spacing: -.01em; color: var(--accent-text); }
.display { font-size: clamp(44px, 6.4vw + 20px, 96px); font-weight: 700; line-height: 1.02; letter-spacing: -.045em; }
.display span { display: block; color: var(--display-accent); font-weight: 600; }
.title { font-size: clamp(30px, 3.6vw + 14px, 60px); font-weight: 600; line-height: 1.06; letter-spacing: -.035em; }
.split .title { font-size: clamp(30px, 2.6vw + 16px, 52px); }
.title-sm { font-size: clamp(25px, 1.4vw + 18px, 36px); font-weight: 600; line-height: 1.12; letter-spacing: -.025em; }
.lead { font-size: clamp(19px, 1.7vw, 22px); font-weight: 400; line-height: 1.42; letter-spacing: -.012em; color: var(--text-2); }
.muted { color: var(--text-2); }
.small { font-size: 13px; letter-spacing: .005em; }
.num { font-weight: 600; letter-spacing: -.035em; line-height: 1; font-variant-numeric: lining-nums tabular-nums; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 0 24px; border: 0; border-radius: var(--pill);
  font-size: 17px; font-weight: 500; letter-spacing: -.01em; line-height: 1.2; white-space: nowrap;
  cursor: pointer; text-decoration: none; background: transparent; color: inherit;
  transition: background-color .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent-hover); }
.btn-secondary { background: var(--surface-2); color: var(--text); }
.btn-secondary:hover { background: var(--accent-tint); }
.section--alt .btn-secondary { background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); }
.btn-link { min-height: 44px; padding: 0; color: var(--accent-text); border-radius: 4px; }
.btn-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.btn-sm { min-height: 36px; padding: 0 16px; font-size: 14px; }
.btn .chev { display: inline-block; transition: transform .2s var(--ease); }
.btn:hover .chev { transform: translateX(3px); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-6); }

/* ── Navigation ─────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 30; height: var(--nav-h);
  background: var(--nav-bg); backdrop-filter: saturate(1.8) blur(20px); -webkit-backdrop-filter: saturate(1.8) blur(20px);
  border-bottom: 1px solid var(--line);
}
/* Three columns: logo · centred links · actions. The outer columns share the leftover space equally,
   so the links sit at the exact centre of the bar; if a side needs more room it grows instead of overlapping. */
.nav-inner { height: 100%; display: grid; grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr); align-items: center; column-gap: var(--s-6); }
.nav-actions { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: var(--s-3); }
.nav-logo { grid-column: 1; justify-self: start; display: flex; align-items: center; height: 44px; flex: none; }
.nav-logo img { height: 34px; width: auto; }
.nav-links { grid-column: 2; display: flex; gap: clamp(16px, 2vw, 28px); white-space: nowrap; font-size: 14px; font-weight: 400; letter-spacing: 0; }
.nav-links a { color: var(--text); opacity: .82; transition: opacity .2s; }
.nav-links a:hover { opacity: 1; }
/* Language: a round button with a small brand-coloured flag inside; cycles uz → ru → en */
.lang-btn {
  position: relative; width: 40px; height: 40px; flex: none; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--surface-2);
  transition: background-color .2s var(--ease), transform .2s var(--ease);
}
.lang-btn::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 22px; height: 15px; transform: translate(-50%, -50%);
  border-radius: 3.5px; background: var(--flag) center / cover no-repeat;
  box-shadow: 0 0 0 1px var(--flag-ring), 0 1px 2px rgba(0, 0, 0, .12);
}
.lang-btn:hover { background: var(--accent-tint); }
.lang-btn:active { transform: scale(.94); }
.lang-btn.is-uz { --flag: url("../images/flags/uz.svg"); }
.lang-btn.is-ru { --flag: url("../images/flags/ru.svg"); }
.lang-btn.is-en { --flag: url("../images/flags/gb.svg"); }
:root { --flag-ring: rgba(28, 28, 28, .09); }
:root[data-theme="dark"] { --flag-ring: rgba(253, 251, 247, .16); }
.icon-btn { position: relative; width: 40px; height: 40px; flex: none; padding: 0; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--text); cursor: pointer; transition: background-color .2s; }
.icon-btn:hover { background: var(--accent-tint); }
.theme-toggle::before { content: ""; position: absolute; inset: 10px; background: currentColor;
  -webkit-mask: var(--theme-icon) center / contain no-repeat; mask: var(--theme-icon) center / contain no-repeat; }
:root { --theme-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.5 14.2A8.5 8.5 0 1 1 9.8 3.5a7 7 0 0 0 10.7 10.7z'/%3E%3C/svg%3E"); }
:root[data-theme="dark"] { --theme-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='4.2' fill='black'/%3E%3Cpath d='M12 2v2.2M12 19.8V22M4.9 4.9l1.6 1.6M17.5 17.5l1.6 1.6M2 12h2.2M19.8 12H22M4.9 19.1l1.6-1.6M17.5 6.5l1.6-1.6'/%3E%3C/svg%3E"); }
.icon-btn::after, .lang-btn::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; }
.burger span { position: absolute; left: 12px; right: 12px; top: calc(50% - .75px); height: 1.5px; border-radius: 1px; background: currentColor; transition: transform .3s var(--ease), opacity .2s; }
.burger span:nth-child(1) { transform: translateY(-5px); }
.burger span:nth-child(3) { transform: translateY(5px); }
.burger.is-open span:nth-child(1) { transform: rotate(45deg); }
.burger.is-open span:nth-child(2) { opacity: 0; }
.burger.is-open span:nth-child(3) { transform: rotate(-45deg); }
.mobile-menu {
  position: sticky; top: var(--nav-h); z-index: 29; display: flex; flex-direction: column;
  padding: var(--s-2) var(--gutter) var(--s-6); background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-md);
}
.mobile-menu a:not(.btn) { padding: 14px 0; font-size: 22px; font-weight: 600; letter-spacing: -.02em; border-bottom: 1px solid var(--line); }
.mobile-menu .btn { margin-top: var(--s-5); }
.logo-dark { display: none !important; }
:root[data-theme="dark"] .logo-dark { display: block !important; }
:root[data-theme="dark"] .logo-light { display: none !important; }

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(36px, 6vw, 80px); align-items: center; padding-block: clamp(48px, 7vw, 96px) clamp(64px, 8vw, 112px); }
.hero .lead { margin-top: var(--s-6); max-width: 30ch; }
.hero .actions { margin-top: var(--s-10); }
/* Phones and tablets: the full landscape photo at 16:9. Laptops and up: a portrait crop of its left part —
   sky, the arched terrace with olive trees and the facade receding in perspective. */
.hero-media { width: 100%; aspect-ratio: 16 / 9; }
.hero-media img { object-position: 20% 50%; }

/* ── Media ──────────────────────────────────────────────────────────────── */
.frame { overflow: hidden; border-radius: var(--r-lg); background: var(--surface-2); isolation: isolate; }
.frame img { width: 100%; height: 100%; object-fit: cover; display: block; filter: var(--img-dim); transition: transform .8s var(--ease); }
.zoom:hover img { transform: scale(1.03); }

/* ── Cards ──────────────────────────────────────────────────────────────── */
.card { background: var(--card); border-radius: var(--r-lg); padding: clamp(24px, 3vw, 36px); }
.tile { background: var(--tile); color: var(--on-tile); }
.tile .muted, .tile p { color: var(--on-tile-2); }
.tile .eyebrow { color: var(--gold); }
.card h3 { font-size: 21px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-4); }

/* ── Stats ──────────────────────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--card); border-radius: var(--r-lg); overflow: hidden; }
.stats .stat { container-type: inline-size; padding: clamp(20px, 3.4vw, 44px); box-shadow: inset -1px 0 var(--line), inset 0 -1px var(--line); }
.stats-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4); }
.stats-cards .stat { container-type: inline-size; padding: clamp(20px, 3.4vw, 40px); background: var(--card); border-radius: var(--r-lg); }
.stat .num { font-size: clamp(26px, 27cqi, 72px); white-space: nowrap; }
.stat p { margin-top: var(--s-3); font-size: 15px; color: var(--text-2); letter-spacing: 0; }

/* ── Chips ──────────────────────────────────────────────────────────────── */
.chip { display: inline-block; max-width: 100%; min-height: 32px; line-height: 1.3; padding: 7px 14px; overflow-wrap: anywhere; border-radius: var(--pill); background: var(--surface-2); font-size: 14px; font-weight: 500; letter-spacing: 0; color: var(--text); }
.section--alt .chip, .card .chip { background: var(--accent-tint); }
.apt-group .chip, .project-head .chip { white-space: nowrap; }
.chip--solid { background: var(--gold) !important; color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }

/* ── Genplan ────────────────────────────────────────────────────────────── */
.genplan { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-6); align-items: start; }
.genplan-map { position: relative; aspect-ratio: 975 / 810; }
.genplan-map > img { position: absolute; inset: 0; }
/* Block outlines drawn over the site plan, in the image's own pixel space so they scale with it.
   The plan is a dark aerial photo, so gold reads well on it in both themes. */
.block-shapes { position: absolute; inset: 0; width: 100%; height: 100%; }
.block-shape {
  fill: transparent; stroke: transparent; stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke;
  cursor: pointer; transition: fill .2s var(--ease), stroke .2s var(--ease);
}
.block-shape:hover { fill: rgba(192, 142, 63, .16); stroke: rgba(192, 142, 63, .8); }
.block-shape.is-active { fill: rgba(192, 142, 63, .28); stroke: var(--gold); stroke-width: 2.5; filter: drop-shadow(0 0 6px rgba(192, 142, 63, .55)); }
.segmented { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; padding: 3px; margin-bottom: var(--s-4); border-radius: var(--pill); background: var(--surface-2); }
.section--alt .segmented { background: var(--accent-tint); }
.seg { height: 40px; padding: 0; border: 0; border-radius: var(--pill); background: transparent; color: var(--text-2); font-size: 15px; font-weight: 600; cursor: pointer; transition: background-color .2s, color .2s, box-shadow .2s; }
.seg:hover { color: var(--text); }
.seg.is-active { background: var(--bg); color: var(--text); box-shadow: var(--shadow-sm); }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); flex-wrap: wrap; }
.panel-head h3 { font-size: 32px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; }
.panel-head > span { font-size: 14px; font-weight: 500; color: var(--text-2); letter-spacing: 0; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); margin-top: var(--s-6); }
.kpis > div { container-type: inline-size; padding: var(--s-4); border-radius: var(--r); background: var(--surface); }
.kpis .num { font-size: 30px; }
.kpis .num--sm { font-size: clamp(15px, 21cqi, 20px); letter-spacing: -.02em; line-height: 1.5; white-space: nowrap; }
.kpis p { margin-top: var(--s-1); font-size: 13px; color: var(--text-2); letter-spacing: 0; }
.apt-groups { display: flex; flex-direction: column; gap: var(--s-3); margin-top: var(--s-6); }
.apt-group { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: var(--s-3); align-items: start; }
.apt-group > span { padding-top: 6px; font-size: 14px; font-weight: 600; letter-spacing: 0; }
.panel .btn { margin-top: var(--s-6); }

/* ── Dialog ─────────────────────────────────────────────────────────────── */
.dialog-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: var(--s-5); background: var(--backdrop); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); animation: fade .25s var(--ease); }
.dialog { width: 100%; max-width: 1100px; max-height: 92vh; overflow: auto; padding: var(--s-5); border-radius: var(--r-lg); background: var(--bg); color: var(--text); box-shadow: var(--shadow-lg); animation: pop .3s var(--ease); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); padding: var(--s-1) var(--s-1) var(--s-4); }
.dialog-head h3 { font-size: 21px; font-weight: 600; letter-spacing: -.02em; }
.dialog .frame { border-radius: var(--r); background: #1A1A1A; }   /* matches the plans' own dark background */
.dialog .frame img { filter: none; height: auto; max-height: calc(92vh - 110px); object-fit: contain; }
@media (max-width: 599px) {
  /* phones: full-screen sheet; the plan is shown at twice the screen width and pans sideways */
  .dialog-backdrop { padding: 0; place-items: stretch; }
  .dialog { max-width: none; max-height: none; height: 100%; border-radius: 0; padding: var(--s-4) var(--s-4) var(--s-6); display: flex; flex-direction: column; }
  .dialog .frame { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; display: flex; align-items: center; }
  .dialog .frame img { width: 200%; max-width: none; max-height: none; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(8px); } }

/* ── Lists ──────────────────────────────────────────────────────────────── */
.feature-list { display: flex; flex-direction: column; gap: var(--s-3); margin-top: var(--s-8); }
.feature-list > div { display: flex; align-items: center; gap: var(--s-4); font-size: 17px; }
.badge { display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%; background: var(--accent-tint); color: var(--accent-text); font-size: 14px; font-weight: 600; letter-spacing: 0; }
.tile .badge { background: rgba(192, 142, 63, .2); color: var(--gold); }
.check-list { display: flex; flex-direction: column; gap: var(--s-3); margin-top: var(--s-5); font-size: 16px; }
.check-list span { display: flex; gap: var(--s-3); align-items: center; }
.check-list span::before { content: ""; width: 20px; height: 20px; flex: none; border-radius: 50%; background: var(--accent-tint) var(--check) center / 12px no-repeat; }
.tile .check-list span::before { background-color: rgba(192, 142, 63, .2); }
:root { --check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%2380592A' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 6.3l2.3 2.2 4.7-5'/%3E%3C/svg%3E"); }
:root[data-theme="dark"] { --check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23D0A35A' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 6.3l2.3 2.2 4.7-5'/%3E%3C/svg%3E"); }
.tile .check-list span::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23C08E3F' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 6.3l2.3 2.2 4.7-5'/%3E%3C/svg%3E"); }

/* ── Yard collage ───────────────────────────────────────────────────────── */
.collage { display: grid; grid-template-columns: 1.2fr 1fr; gap: var(--s-4); }
.collage > .frame { aspect-ratio: 3 / 4.2; }
.collage-col { display: grid; gap: var(--s-4); }
.collage-col .frame { aspect-ratio: auto; height: 100%; }

/* ── Infrastructure ─────────────────────────────────────────────────────── */
.amenities { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-5); }
.amenity { background: var(--card); border-radius: var(--r-lg); overflow: hidden; }
.amenity .frame { aspect-ratio: 4 / 3; border-radius: 0; }
.amenity figcaption { padding: var(--s-5) var(--s-6) var(--s-6); font-size: 19px; font-weight: 600; letter-spacing: -.02em; }

/* ── Quality ────────────────────────────────────────────────────────────── */
.quality { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-5); align-items: stretch; }
.big-num { font-size: clamp(88px, 12vw, 160px); font-weight: 700; line-height: .92; letter-spacing: -.06em; }
.big-num small { font-size: .3em; font-weight: 600; letter-spacing: -.02em; color: var(--display-accent); margin-left: 6px; }
.specs { display: flex; flex-direction: column; margin-top: var(--s-8); }
.specs > div { padding: var(--s-4) 0; border-top: 1px solid var(--line); }
.specs h3 { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.specs p { margin-top: 2px; color: var(--text-2); font-size: 15px; letter-spacing: 0; }
.layers { display: flex; flex-direction: column; margin-top: var(--s-5); }
.layers > div { display: grid; grid-template-columns: 32px minmax(0, 1fr) 40px; gap: var(--s-4); align-items: center; padding: 14px 0; border-top: 1px solid var(--line); font-size: 16px; }
.layers > div > span:last-child { height: 8px; border-radius: var(--pill); box-shadow: inset 0 0 0 1px var(--line); }
.layers .l1 { background: var(--swatch-1); } .layers .l2 { background: var(--swatch-2); } .layers .l3 { background: var(--swatch-3); }
.layers .l4 { background: var(--swatch-4); } .layers .l5 { background: var(--swatch-5); } .layers .l6 { background: var(--swatch-6); }

/* ── Utilities ──────────────────────────────────────────────────────────── */
.utilities { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-3); margin-top: var(--s-8); }
.utilities > div { padding: var(--s-6); border-radius: var(--r); background: var(--card); }
.utilities .badge { margin-bottom: var(--s-5); }
.utilities h3 { font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
.utilities p { margin-top: var(--s-1); font-size: 15px; color: var(--text-2); letter-spacing: 0; }

/* ── Plans ──────────────────────────────────────────────────────────────── */
.plans { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-4); }
.plan { display: flex; flex-direction: column; padding: var(--s-3); background: var(--card); border-radius: var(--r-lg); transition: box-shadow .3s var(--ease), transform .3s var(--ease); }
.plan:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.plan .frame { aspect-ratio: 3 / 2; padding: var(--s-3); border-radius: var(--r); background: #fff; }
.plan .frame img { object-fit: contain; filter: none; }
.plan-meta { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); padding: var(--s-4) var(--s-3) var(--s-2); }
.plan-meta > span:first-child { font-size: 15px; font-weight: 500; color: var(--text-2); letter-spacing: 0; }
.plan-meta .num { font-size: 26px; white-space: nowrap; }

/* ── Location ───────────────────────────────────────────────────────────── */
.map { aspect-ratio: 1440 / 660; }
.nearby { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-4); margin-top: var(--s-4); align-items: start; }
.nearby .card { padding: var(--s-6); }
.nearby .card h3 { font-size: 19px; margin-bottom: var(--s-2); }
.poi { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: var(--s-3); align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.poi:first-of-type { border-top: 0; }
.poi > b { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-tint); color: var(--accent-text); display: grid; place-items: center; font-size: 12px; font-weight: 600; letter-spacing: 0; }
.poi > span { font-size: 15px; line-height: 1.35; letter-spacing: 0; }
.poi > em { font-style: normal; text-align: right; line-height: 1.25; white-space: nowrap; }
.poi > em b { display: block; font-size: 15px; font-weight: 600; letter-spacing: 0; }
.poi > em small { font-size: 12px; color: var(--text-2); letter-spacing: 0; }
.note { margin-top: var(--s-5); }

/* ── Audience (life / invest) ───────────────────────────────────────────── */
.audience { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-5); }
.audience > div { display: flex; flex-direction: column; overflow: hidden; border-radius: var(--r-lg); background: var(--card); }
.audience .frame { aspect-ratio: 2 / 1; border-radius: 0; }
.audience .body { padding: clamp(24px, 3vw, 40px); }
.audience h3 { font-size: clamp(26px, 2.4vw, 32px); font-weight: 600; letter-spacing: -.03em; line-height: 1.12; }
.audience p { margin-top: var(--s-3); color: var(--text-2); }
.audience > div.tile { background: var(--tile); }
.audience .tile p { color: var(--on-tile-2); }
.audience .chips { margin-top: var(--s-6); }
.roi { margin-top: var(--s-6); display: flex; align-items: baseline; gap: var(--s-3); flex-wrap: wrap; }
.roi .num { font-size: clamp(36px, 2.4vw + 26px, 60px); color: var(--gold); }
.roi > span:last-child { font-size: 17px; font-weight: 500; color: var(--on-tile-2); }

/* ── Developer ──────────────────────────────────────────────────────────── */
.dev-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); flex: 1 1 340px; max-width: 480px; }
.dev-stats > div { container-type: inline-size; min-width: 0; padding: var(--s-5); border-radius: var(--r); background: var(--card); }
.dev-stats .num { font-size: clamp(22px, 34cqi, 40px); }
.dev-stats p { margin-top: var(--s-2); font-size: 13px; color: var(--text-2); max-width: 16ch; letter-spacing: 0; }
.projects { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-5); }
.project { border-radius: var(--r-lg); overflow: hidden; background: var(--card); }
.project .frame { aspect-ratio: 612 / 254; border-radius: 0; }
.project .body { padding: clamp(20px, 2.4vw, 32px); }
.project-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.project-head h3 { font-size: 28px; font-weight: 600; letter-spacing: -.03em; }
.project .addr { margin-top: var(--s-2); font-size: 15px; font-weight: 600; letter-spacing: 0; }
.project p:last-child { margin-top: var(--s-1); font-size: 15px; color: var(--text-2); letter-spacing: 0; }

/* ── Contact ────────────────────────────────────────────────────────────── */
/* No overflow clipping on the card, so the block picker's menu can extend past it; the photo and the body round their own corners instead. */
.contact { display: grid; grid-template-columns: minmax(0, 1fr); border-radius: var(--r-lg); background: var(--card); }
.contact > .frame { aspect-ratio: 4 / 3; border-radius: var(--r-lg) var(--r-lg) 0 0; }
.contact-body { padding: clamp(28px, 5vw, 64px); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.contact-body::before { border-radius: inherit; }
.form { display: flex; flex-direction: column; gap: var(--s-4); margin-top: var(--s-8); max-width: 440px; }
.field label { display: block; margin: 0 0 6px 4px; font-size: 13px; font-weight: 500; color: var(--text-2); letter-spacing: 0; }
.input {
  width: 100%; min-height: 50px; padding: 0 16px; border: 1px solid transparent; border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--text); font-size: 17px; caret-color: var(--gold);
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.section--alt .input { background: var(--surface); }
.input::placeholder { color: var(--text-2); opacity: .8; }
.input:hover { border-color: var(--line-strong); }
.input:focus-visible { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px var(--ring); }
/* Block picker: custom listbox. The menu is exactly as wide as its trigger and opens 6px below it;
   corner radii are nested (menu 14px = option 8px + 6px padding). */
.select { position: relative; }
.select-trigger { position: relative; display: flex; align-items: center; padding-right: 44px; text-align: left; cursor: pointer; }
.select-trigger > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-trigger::after {
  content: ""; position: absolute; right: 16px; top: 50%; width: 12px; height: 8px; margin-top: -4px;
  background: var(--chevron) center / contain no-repeat; transition: transform .2s var(--ease);
}
.select.is-open .select-trigger { border-color: var(--gold); box-shadow: 0 0 0 4px var(--ring); }
.select.is-open .select-trigger::after { transform: rotate(180deg); }
.select-menu {
  position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; right: 0; margin: 0; padding: 6px; list-style: none;
  max-height: min(320px, 50vh); overflow-y: auto; overscroll-behavior: contain;
  background: var(--menu-bg); border: 1px solid var(--menu-line); border-radius: 14px; box-shadow: var(--shadow-lg);
  transform-origin: top center; animation: menu-in .16s var(--ease);
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px) scale(.985); } }
.select-option {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  min-height: 44px; padding: 0 12px; border-radius: 8px;
  font-size: 16px; font-weight: 400; color: var(--text); cursor: pointer; user-select: none;
  transition: background-color .12s var(--ease), color .12s var(--ease);
}
.select-option + .select-option { margin-top: 2px; }
.select-option.is-active { background: var(--menu-hover); }
.select-option.is-selected { font-weight: 600; color: var(--accent-text); }
.select-option.is-selected::after {
  content: ""; width: 14px; height: 14px; flex: none; background: currentColor;
  -webkit-mask: var(--tick) center / contain no-repeat; mask: var(--tick) center / contain no-repeat;
}
:root {
  --menu-bg: #FDFBF7; --menu-line: rgba(28, 28, 28, .08); --menu-hover: #F2E6CF;
  --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 7.4l3 2.9 6-6.6'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] { --menu-bg: #26231E; --menu-line: rgba(253, 251, 247, .1); --menu-hover: rgba(192, 142, 63, .18); }
.form .btn { align-self: flex-start; margin-top: var(--s-2); }
.form .btn:disabled { opacity: .6; cursor: progress; }
/* Validation */
.field-error {
  display: flex; align-items: flex-start; gap: 6px; margin: 8px 0 0 4px;
  font-size: 13px; font-weight: 500; line-height: 1.35; letter-spacing: 0; color: var(--error-text);
  animation: fade .2s var(--ease);
}
.field-error::before {
  content: ""; width: 14px; height: 14px; flex: none; margin-top: 1px; background: currentColor;
  -webkit-mask: var(--alert-icon) center / contain no-repeat; mask: var(--alert-icon) center / contain no-repeat;
}
.field.is-invalid .input, .field.is-invalid .input:hover { border-color: var(--error-text); }
.field.is-invalid .input:focus-visible, .field.is-invalid .select.is-open .select-trigger { border-color: var(--error-text); box-shadow: 0 0 0 4px var(--error-ring); }
:root {
  --error-ring: rgba(138, 46, 22, .16);
  --alert-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M8 1a7 7 0 1 1 0 14A7 7 0 0 1 8 1zm-.75 3.5v4.5h1.5V4.5zm0 6v1.5h1.5V10.5z'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] { --error-ring: rgba(240, 164, 140, .18); }
/* Phone: the fixed "+998 " is real text; the rest of the pattern is a faint overlay that starts exactly where the typed text ends */
.masked { position: relative; }
.mask {
  position: absolute; inset: 0; display: flex; align-items: center; padding: 0 17px;
  font-size: 17px; white-space: pre; overflow: hidden; pointer-events: none; color: var(--text-2); opacity: .5;
}
.mask-typed { color: transparent; }
.masked .input { font-variant-numeric: tabular-nums; }
.mask { font-variant-numeric: tabular-nums; }
.select:not(.has-value) .select-trigger > span { color: var(--text-2); }
.form-error { margin: 0; padding: 12px 16px; border-radius: var(--r-sm); background: var(--error-bg); color: var(--error-text); font-size: 15px; line-height: 1.4; }
.hp { position: absolute; width: 1px; height: 1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); opacity: 0; pointer-events: none; }   /* spam trap, hidden from people */
:root { --error-bg: #F8E3DC; --error-text: #8A2E16; }
:root[data-theme="dark"] { --error-bg: rgba(214, 96, 64, .16); --error-text: #F0A48C; }
.thanks { margin-top: var(--s-8); max-width: 440px; padding: var(--s-6); border-radius: var(--r); background: var(--accent-tint); }
.thanks div { font-size: 21px; font-weight: 600; letter-spacing: -.02em; }
.thanks p { margin-top: var(--s-1); font-size: 15px; color: var(--text-2); }
.phone-block { margin-top: var(--s-10); padding-top: var(--s-6); border-top: 1px solid var(--line); }
.phone-block .label { font-size: 13px; font-weight: 500; color: var(--text-2); letter-spacing: 0; }
.phone { display: inline-block; margin-top: var(--s-1); font-size: clamp(28px, 3vw, 36px); font-weight: 600; letter-spacing: -.03em; color: var(--text); transition: color .2s; }
.phone:hover { color: var(--accent-text); }
.phone-block p { margin-top: var(--s-2); font-size: 15px; color: var(--text-2); letter-spacing: 0; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.footer { background: var(--surface); color: var(--text-2); border-top: 1px solid var(--line); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: var(--s-6); flex-wrap: wrap; padding-block: var(--s-10); font-size: 13px; letter-spacing: 0; }
.footer-inner img { height: 36px; width: auto; }
.footer-meta { display: flex; flex-direction: column; gap: var(--s-1); text-align: right; }

/* ── Background patterns ────────────────────────────────────────────────────
   Faint motifs drawn as masks so their colour follows the theme tokens:
   a diamond lattice after the facade's openwork panels, a fine dot grid,
   and pinstripes after the logo's bars. Each fades out toward its edges. */
:root {
  --lattice: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M20 0L40 20L20 40L0 20Z' fill='none' stroke='black' stroke-width='.8'/%3E%3Cpath d='M20 15.5L24.5 20L20 24.5L15.5 20Z' fill='black'/%3E%3C/svg%3E");
  --dots: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='1.1' fill='black'/%3E%3C/svg%3E");
}
.hero, .section--alt, .tile, .contact-body, .footer { position: relative; isolation: isolate; }
.hero::before, .section--alt::before, .tile::before, .contact-body::before, .footer::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
}
.hero::before {
  background: var(--pattern-strong);
  -webkit-mask: var(--lattice) center / 44px 44px repeat, radial-gradient(ellipse 55% 75% at 78% 45%, #000, transparent 75%);
  -webkit-mask-composite: source-in;
  mask: var(--lattice) center / 44px 44px repeat, radial-gradient(ellipse 55% 75% at 78% 45%, #000, transparent 75%);
  mask-composite: intersect;
}
.section--alt::before {
  background: var(--pattern);
  -webkit-mask: var(--dots) 0 0 / 22px 22px repeat, linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
  -webkit-mask-composite: source-in;
  mask: var(--dots) 0 0 / 22px 22px repeat, linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
  mask-composite: intersect;
}
.tile::before {
  background: repeating-linear-gradient(90deg, rgba(192, 142, 63, .14) 0 1px, transparent 1px 14px);
  -webkit-mask: linear-gradient(to top left, #000, transparent 60%);
  mask: linear-gradient(to top left, #000, transparent 60%);
}
.contact-body::before {
  background: var(--pattern);
  -webkit-mask: var(--lattice) 0 0 / 36px 36px repeat, radial-gradient(circle at 100% 0, #000, transparent 55%);
  -webkit-mask-composite: source-in;
  mask: var(--lattice) 0 0 / 36px 36px repeat, radial-gradient(circle at 100% 0, #000, transparent 55%);
  mask-composite: intersect;
}
.footer::before {
  background: var(--pattern);
  -webkit-mask: var(--lattice) 0 0 / 36px 36px repeat, linear-gradient(to left, #000, transparent 55%);
  -webkit-mask-composite: source-in;
  mask: var(--lattice) 0 0 / 36px 36px repeat, linear-gradient(to left, #000, transparent 55%);
  mask-composite: intersect;
}

/* ── Responsive ─────────────────────────────────────────────────────────────
   Mobile-first. Breakpoints: xs < 380 · phone · ≥ 480 large phone · ≥ 600 tablet
   · ≥ 1024 laptop · ≥ 1280 desktop. Larger screens keep the desktop layout as is. */
@media (max-width: 379px) {
  :root { --gutter: 16px; }
  .nav-actions { gap: var(--s-2); }
  .nav-logo img { height: 30px; }
  .dev-stats > div { padding: var(--s-3) var(--s-2); }
}
@media (max-width: 1023px) {
  /* no section links below laptop size: logo left, actions right */
  .nav-inner { display: flex; justify-content: space-between; column-gap: var(--s-3); }
}
@media (max-width: 599px) {
  :root { --r-lg: 22px; }
  .footer-meta { text-align: left; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis > div:last-child { grid-column: 1 / -1; }
  .kpis .num { font-size: 26px; }
  .dev-stats { flex-basis: 100%; max-width: none; }
  .dev-stats > div { padding: var(--s-4) var(--s-3); }
  .collage { gap: var(--s-3); }
  .collage-col { gap: var(--s-3); }
  .input, .mask { font-size: 16px; }              /* 16px+ stops iOS zooming into fields */
}
@media (max-width: 859px) {
  .stats, .stats-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 480px) {
  .grid-2, .utilities, .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 600px) {
  .amenities, .nearby, .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* single-column tablet layouts: landscape crops so photos don't tower over the text */
  .split > .frame { aspect-ratio: 4 / 3; }
  .contact > .frame { aspect-ratio: 16 / 9; }
}
@media (min-width: 900px) {
  .amenities { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .quality, .audience { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .hero-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
  .hero-media { aspect-ratio: 4 / 5; max-height: calc(100vh - var(--nav-h) - 96px); min-height: 480px; }
  .split { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split > .frame { aspect-ratio: 4 / 5; }
  .genplan { grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); }
  .plans { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .contact { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
  .contact > .frame { aspect-ratio: auto; min-height: 100%; border-radius: var(--r-lg) 0 0 var(--r-lg); }
  .contact-body { border-radius: 0 var(--r-lg) var(--r-lg) 0; }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  .split .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 1280px) {
  .nearby { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
/* ── Compact layouts for phones and tablets ──────────────────────────────── */
/* Swipe carousels: cards scroll sideways and the next one peeks in at the edge.
   The rail runs to the screen edges; scroll-padding keeps cards aligned with the page gutter. */
@media (max-width: 899px) {
  .amenities, .plans {
    grid-template-columns: none; grid-auto-flow: column; gap: var(--s-3);
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scroll-padding-inline: var(--gutter);
    padding-bottom: 4px;                       /* room for card shadows */
  }
  .amenities::-webkit-scrollbar, .plans::-webkit-scrollbar { display: none; }
  .amenity, .plan { scroll-snap-align: start; }
  .amenities { grid-auto-columns: min(78%, 320px); }
  .amenity figcaption { padding: var(--s-4) var(--s-5) var(--s-5); font-size: 17px; }
  .plan:hover { transform: none; }
}
@media (max-width: 599px) {
  .plans { grid-auto-columns: min(80%, 300px); }
}
@media (min-width: 600px) and (max-width: 899px) {
  .plans { grid-auto-columns: min(44%, 320px); }
}
/* Engineering systems: 2 × 2 at every size, with tighter cards on phones */
.utilities { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 599px) {
  .utilities { gap: var(--s-2); margin-top: var(--s-6); }
  .utilities > div { padding: var(--s-4); }
  .utilities .badge { width: 28px; height: 28px; font-size: 13px; margin-bottom: var(--s-3); }
  .utilities h3 { font-size: 17px; }
  .utilities p { font-size: 14px; line-height: 1.4; }
}
/* Photos beside text sections: landscape crops until the side-by-side layout */
@media (max-width: 1023px) {
  .split > .frame { aspect-ratio: 4 / 3; }
}
/* Site plan: tighter block panel on phones, map and panel side by side on larger tablets */
@media (max-width: 599px) {
  .genplan { gap: var(--s-3); }
  .genplan .panel { padding: var(--s-5) var(--s-4); }
  .panel-head h3 { font-size: 26px; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: var(--s-4); }
  .kpis > div { padding: var(--s-3) 10px; }
  .kpis > div:last-child { grid-column: auto; }
  .kpis .num { font-size: 22px; }
  .kpis .num--sm { font-size: clamp(12px, 19cqi, 18px); line-height: 22px; }
  .kpis p { font-size: 12px; line-height: 1.3; }
  .apt-groups { gap: var(--s-2); margin-top: var(--s-4); }
  .apt-group { grid-template-columns: 64px minmax(0, 1fr); gap: var(--s-2); }
  .apt-group > span { padding-top: 5px; font-size: 13px; }
  .apt-group .chip { min-height: 28px; padding: 5px 10px; font-size: 13px; }
  .chips { gap: 6px; }
  .panel .btn { margin-top: var(--s-5); width: 100%; }
}
@media (min-width: 600px) and (max-width: 1023px) {
  /* map full width; panel below splits into stats (left) and apartment sizes (right) */
  .genplan .panel {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); column-gap: var(--s-6); align-items: start;
    grid-template-areas: "seg seg" "head groups" "kpis groups" "btn groups";
    grid-template-rows: auto auto auto 1fr;
  }
  .genplan .segmented { grid-area: seg; }
  .genplan .panel-head { grid-area: head; }
  .genplan .kpis { grid-area: kpis; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .genplan .kpis > div:last-child { grid-column: 1 / -1; }
  .genplan .apt-groups { grid-area: groups; margin-top: var(--s-2); }
  .genplan .panel .btn { grid-area: btn; justify-self: start; align-self: start; }
  .split > .frame { aspect-ratio: 16 / 10; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
