@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("../fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("../fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("../fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("../fonts/inter-latin-700-normal.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --page: #f6f5f1;
  --surface: #fcfcfb;
  --surface-2: #f0efea;
  --ink: #0f1a2a;
  --ink-2: #4c5361;
  --muted: #858a93;
  --grid: #e3e2dc;
  --axis: #c3c2b7;
  --border: rgba(15, 26, 42, 0.10);
  --brand: #10284a;
  --brand-ink: #f4f1ea;
  --sand: #c8a96a;
  --accent: #2a78d6;
  --rent: #2a78d6;
  --price: #eb6834;
  --up: #006300;
  --down: #b42f2f;
  --good: #0ca30c;
  --critical: #d03b3b;
  --warning: #fab219;
  --shadow: 0 1px 2px rgba(15, 26, 42, 0.06), 0 6px 24px rgba(15, 26, 42, 0.05);
  --radius: 14px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0e0f11;
    --surface: #18191b;
    --surface-2: #222326;
    --ink: #f0efec;
    --ink-2: #c3c2b7;
    --muted: #8f8d87;
    --grid: #2c2c2a;
    --axis: #3a3a37;
    --border: rgba(255, 255, 255, 0.10);
    --brand: #0b1a30;
    --brand-ink: #f4f1ea;
    --accent: #3987e5;
    --rent: #3987e5;
    --price: #d95926;
    --up: #0ca30c;
    --down: #e66767;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0e0f11;
  --surface: #18191b;
  --surface-2: #222326;
  --ink: #f0efec;
  --ink-2: #c3c2b7;
  --muted: #8f8d87;
  --grid: #2c2c2a;
  --axis: #3a3a37;
  --border: rgba(255, 255, 255, 0.10);
  --brand: #0b1a30;
  --brand-ink: #f4f1ea;
  --accent: #3987e5;
  --rent: #3987e5;
  --price: #d95926;
  --up: #0ca30c;
  --down: #e66767;
  --shadow: none;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font: 400 16px/1.55 var(--font); -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; margin: 0; }
h1 { font-size: clamp(30px, 4.4vw, 48px); font-weight: 700; }
h2 { font-size: 24px; font-weight: 650; }
h3 { font-size: 17px; font-weight: 600; }
p { margin: 0 0 12px; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .wrap { padding: 0 16px; } }

/* header */
.top { background: var(--brand); color: var(--brand-ink); }
.top .wrap { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--brand-ink); font-weight: 650; font-size: 17px; letter-spacing: -0.01em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand svg { flex: none; }
.nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav a { color: rgba(244, 241, 234, 0.78); padding: 8px 12px; border-radius: 8px; font-size: 15px; font-weight: 500; white-space: nowrap; }
.nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.08); text-decoration: none; }
.nav a[aria-current="page"] { color: #fff; background: rgba(255, 255, 255, 0.12); }
@media (max-width: 760px) {
  .top .wrap { height: auto; flex-wrap: wrap; padding-top: 12px; padding-bottom: 8px; gap: 6px; }
  .nav { margin-left: -12px; width: calc(100% + 12px); }
}

/* hero */
.hero, .page-head { margin: 0; }
.hero { background: var(--brand); color: var(--brand-ink); padding: 36px 0 112px; position: relative; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 140px; pointer-events: none;
  background: url("../img/skyline.svg") bottom center / auto 140px repeat-x; opacity: 0.16;
}
.hero h1 { max-width: 820px; }
.hero h1 em { font-style: normal; color: var(--sand); }
.hero .lede { color: rgba(244, 241, 234, 0.8); font-size: 18px; max-width: 720px; margin-top: 14px; }
.hero .facts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 18px; font-size: 14px; color: rgba(244, 241, 234, 0.72); }
.hero .facts b { color: #fff; font-weight: 600; }
.page-head { background: var(--brand); color: var(--brand-ink); padding: 34px 0 40px; }
.page-head .lede { color: rgba(244, 241, 234, 0.8); font-size: 17px; max-width: 760px; margin-top: 10px; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 22px 24px; }
@media (max-width: 640px) { .pad { padding: 18px 16px; } }
.lift { margin-top: -84px; position: relative; z-index: 2; }
section { margin: 28px 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.ink2 { color: var(--ink-2); }

/* controls */
.controls { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.beds-note { margin: 10px 0 0; min-height: 1.4em; }
.field > label, .field > .lbl { font-size: 12.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.combo { position: relative; width: 300px; max-width: 100%; }
.combo input {
  width: 100%; height: 44px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--ink); font: 500 16px var(--font); padding: 0 40px 0 14px; outline: none;
}
.combo input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.combo .chev { position: absolute; right: 12px; top: 12px; pointer-events: none; color: var(--muted); }
.combo ul {
  position: absolute; z-index: 20; left: 0; right: 0; top: 48px; margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,0.16);
  max-height: 340px; overflow-y: auto; display: none;
}
.combo.open ul { display: block; }
.combo li { padding: 9px 10px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.combo li .o { color: var(--muted); font-size: 13px; text-align: right; }
.combo li[aria-selected="true"], .combo li:hover { background: var(--surface-2); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button {
  font: 500 15px var(--font); color: var(--ink-2); background: transparent; border: 0; border-radius: 8px;
  height: 36px; padding: 0 13px; cursor: pointer; white-space: nowrap;
}
.seg button:hover:not(:disabled) { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,0.12); font-weight: 600; }
.seg button:disabled { opacity: 0.35; cursor: not-allowed; }
.seg.rentprice button[aria-pressed="true"][data-v="rent"] { box-shadow: inset 0 -2px 0 var(--rent), 0 1px 3px rgba(0,0,0,0.12); }
.seg.rentprice button[aria-pressed="true"][data-v="price"] { box-shadow: inset 0 -2px 0 var(--price), 0 1px 3px rgba(0,0,0,0.12); }

/* answer */
.answer { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 0; border-top: 1px solid var(--border); margin-top: 22px; }
.answer > div { padding: 20px 22px 4px 0; }
.answer > div + div { padding-left: 22px; border-left: 1px solid var(--border); }
@media (max-width: 860px) {
  .answer { grid-template-columns: 1fr; }
  .answer > div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--border); }
}
.question { font-size: 19px; font-weight: 600; line-height: 1.35; }
.question .what { color: var(--ink-2); font-weight: 500; }
.stat .label { font-size: 13.5px; color: var(--ink-2); font-weight: 500; }
.stat .value { font-size: 40px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; margin-top: 4px; }
.stat .value small { font-size: 18px; font-weight: 600; color: var(--ink-2); margin-right: 4px; }
.stat .sub { font-size: 14px; color: var(--ink-2); margin-top: 4px; }
.delta { display: inline-flex; align-items: center; gap: 4px; font-weight: 650; font-size: 15px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); }
.delta.up { color: var(--up); }
.delta.down { color: var(--down); }
.range-bar { position: relative; height: 8px; border-radius: 4px; background: var(--surface-2); margin: 12px 0 6px; max-width: 280px; }
.range-bar i { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.range-bar b { position: absolute; top: -4px; width: 3px; height: 16px; border-radius: 2px; background: var(--ink); }

/* chart */
.chart-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px 18px; margin-bottom: 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.key-line { width: 18px; height: 2px; border-radius: 1px; display: inline-block; }
.key-band { width: 18px; height: 10px; border-radius: 3px; display: inline-block; }
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid line { stroke: var(--grid); }
.chart .axis text { fill: var(--muted); font: 12px var(--font); font-variant-numeric: tabular-nums; }
.chart .axis path, .chart .axis line { stroke: var(--axis); }
.chart .baseline { stroke: var(--axis); }
.tip {
  position: absolute; pointer-events: none; z-index: 10; min-width: 190px; padding: 10px 12px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: 0 8px 28px rgba(0,0,0,0.16); font-size: 13px;
  opacity: 0; transition: opacity 0.12s; color: var(--ink); white-space: nowrap;
}
.tip .t { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.tip .r { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tip .r span:first-child { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); }
.tip .r b { font-weight: 650; font-variant-numeric: tabular-nums; }
.viewtoggle { font: 500 13.5px var(--font); color: var(--accent); background: none; border: 0; cursor: pointer; padding: 0; }

/* notes and tiles */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 900px) { .grid3, .grid4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .grid2, .grid3, .grid4 { grid-template-columns: 1fr; } }
.tile .label { font-size: 13.5px; color: var(--ink-2); font-weight: 500; }
.tile .value { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; margin: 6px 0 4px; }
.tile .sub { font-size: 13.5px; color: var(--muted); }
.note { border-left: 3px solid var(--sand); padding: 2px 0 2px 14px; color: var(--ink-2); font-size: 14.5px; }

/* tables */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th { text-align: left; font-size: 12.5px; letter-spacing: 0.03em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 10px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 10px 10px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
th.num, td.num { text-align: right; }
tr:last-child td { border-bottom: 0; }
th[data-sort] { cursor: pointer; }
th[data-sort]:hover { color: var(--ink); }
th[aria-sort="descending"]::after { content: " ↓"; }
th[aria-sort="ascending"]::after { content: " ↑"; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); }
.pill.pass::before, .pill.fail::before, .pill.warn::before { content: ""; width: 8px; height: 8px; border-radius: 50%; }
.pill.pass::before { background: var(--good); }
.pill.fail::before { background: var(--critical); }
.pill.warn::before { background: var(--warning); }

/* rankings bars */
.rank-row { display: grid; grid-template-columns: minmax(120px, 230px) 1fr 74px; align-items: center; gap: 12px; padding: 6px 0; }
.rank-row .nm { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-row .nm a { color: var(--ink); }
.rank-row .v { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; font-size: 14.5px; }

/* pipeline */
.steps { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; counter-reset: s; }
@media (max-width: 1000px) { .steps { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .steps { grid-template-columns: 1fr; } }
.step { position: relative; padding: 16px; border-radius: 12px; background: var(--surface-2); }
.step::before { counter-increment: s; content: counter(s); display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-weight: 650; font-size: 14px; margin-bottom: 10px; }
.step h3 { font-size: 16px; margin-bottom: 6px; }
.step p { font-size: 14px; color: var(--ink-2); margin: 0; }

/* footer */
footer { margin-top: 56px; padding: 30px 0 40px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13.5px; }
footer .wrap { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }
@media (max-width: 760px) { footer .wrap { grid-template-columns: 1fr; } }
footer a { color: var(--ink-2); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.loading { opacity: 0.55; transition: opacity 0.2s; }
.seg button[hidden] { display: none; }
