/* SPDX-License-Identifier: MIT
   Copyright (c) 2026 John Luke NIKABOU (LucNIK) */

@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap;
  src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap;
  src: url("fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap;
  src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap;
  src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap;
  src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }

/* Gold by day, bordeaux by night: the same identity as github.com/LucNIK. */
:root {
  color-scheme: light;
  --bg: #f7f6f2;
  --surface: #ffffff;
  --text: #141417;
  --muted: #66656c;
  --line: #e4e1d9;
  --accent: #946f00;
  --accent-soft: rgba(148, 111, 0, 0.1);
  --warn: #9a3412;
  --radius: 14px;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d0c0f;
    --surface: #16151a;
    --text: #ece9e3;
    --muted: #9b98a0;
    --line: #2a282f;
    --accent: #cf5770;
    --accent-soft: rgba(207, 87, 112, 0.14);
    --warn: #f0a070;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0c0f;
  --surface: #16151a;
  --text: #ece9e3;
  --muted: #9b98a0;
  --line: #2a282f;
  --accent: #cf5770;
  --accent-soft: rgba(207, 87, 112, 0.14);
  --warn: #f0a070;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s, color 0.25s;
}
a { color: inherit; text-decoration-color: var(--line); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }

header.top { display: flex; align-items: center; justify-content: space-between; padding: 28px 0 8px; }
.brand { display: inline-flex; align-items: baseline; gap: 2px; font-weight: 600; font-size: 20px;
  letter-spacing: -0.02em; text-decoration: none; }
.brand i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); display: inline-block; }
nav { display: flex; align-items: center; gap: 18px; font-size: 14px; color: var(--muted); }
nav a { text-decoration: none; }
nav a:hover, nav a[aria-current="page"] { color: var(--text); }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer; }
.icon-btn:hover { border-color: var(--accent); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn svg { display: none; }
:root:not([data-theme-mode]) .icon-btn .auto,
:root[data-theme-mode="auto"] .icon-btn .auto,
:root[data-theme-mode="light"] .icon-btn .sun,
:root[data-theme-mode="dark"] .icon-btn .moon { display: block; }

.hero { padding: 56px 0 28px; }
h1 { font-size: clamp(28px, 5.4vw, 40px); line-height: 1.12; letter-spacing: -0.025em; font-weight: 600; margin: 0 0 14px; }
.lede { color: var(--muted); margin: 0; max-width: 34em; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
form.card { display: grid; gap: 18px; }
label, .label { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
input[type="text"], input[type="number"], input[type="search"] {
  width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 13px; transition: border-color 0.15s;
  -moz-appearance: textfield; appearance: textfield;
}
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input:focus, select:focus { outline: none; border-color: var(--accent); }
select { width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 13px; appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.row.building { grid-template-columns: repeat(2, 1fr); }
.hint { margin: 8px 0 0; font-size: 13px; color: var(--muted); min-height: 1em; }
.hint.found { color: var(--accent); }
.row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.row > div[hidden] { display: none; }
@media (max-width: 520px) { .row { grid-template-columns: 1fr 1fr; } }

.combo { position: relative; }
.combo ul { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px;
  list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12); }
.combo li { padding: 9px 10px; border-radius: 7px; cursor: pointer; font-size: 15px; }
.combo li small { color: var(--muted); margin-left: 6px; }
.combo li[aria-selected="true"], .combo li:hover { background: var(--accent-soft); }

.seg { display: inline-grid; grid-auto-flow: column; gap: 4px; padding: 4px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--bg); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { margin: 0; padding: 7px 16px; border-radius: 999px; cursor: pointer; color: var(--muted); font-size: 14px; }
.seg input:checked + label { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--line); }
.seg input:focus-visible + label { outline: 2px solid var(--accent); }

button.primary { justify-self: start; font: 500 15px var(--sans); color: var(--bg); background: var(--text);
  border: 0; border-radius: 999px; padding: 12px 26px; cursor: pointer; transition: background-color 0.15s; }
button.primary:hover { background: var(--accent); }
button.primary:disabled { opacity: 0.5; cursor: progress; }
button.secondary { margin-top: 18px; font: 500 14px var(--sans); color: var(--text); background: transparent;
  border: 1px solid var(--line); border-radius: 999px; padding: 9px 18px; cursor: pointer; }
button.secondary:hover { border-color: var(--accent); color: var(--accent); }
button.link { font: 500 13px var(--sans); color: var(--accent); background: none; border: 0; padding: 4px 0; cursor: pointer; }
.banner { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 12px;
  padding: 12px 16px; border-radius: var(--radius); background: var(--accent-soft); font-size: 14px; }
.compare-head { display: flex; justify-content: space-between; align-items: baseline; }
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 4px 0 14px; }
.compare-grid > div { border: 1px solid var(--line); border-radius: 10px; padding: 14px; min-width: 0; }
.compare-grid .tag { font: 500 12px var(--mono); color: var(--accent); }
.compare-grid .where { font-size: 13px; color: var(--muted); margin: 2px 0 8px; overflow-wrap: anywhere; }
.compare-grid .big { font: 500 24px var(--mono); letter-spacing: -0.02em; }
.compare-grid dl { margin: 8px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 13px; }
.compare-grid dt { color: var(--muted); }
.compare-grid dd { margin: 0; text-align: right; font-family: var(--mono); font-size: 12.5px; }
.compare-gap { margin: 0 0 16px; font-size: 15px; }
.compare-gap strong { font-family: var(--mono); font-weight: 500; }
h3 { font-size: 13px; font-weight: 500; color: var(--muted); margin: 0 0 4px; }
@media (max-width: 480px) { .compare-grid { grid-template-columns: 1fr; } }
.error { color: var(--warn); font-size: 14px; margin: 0; }

#result { margin: 28px 0 0; display: grid; gap: 16px; }
.price { font: 500 clamp(36px, 8vw, 54px)/1 var(--mono); letter-spacing: -0.03em; margin: 6px 0 10px; }
.sub { color: var(--muted); font-size: 15px; }
.sub strong { color: var(--text); font-weight: 500; font-family: var(--mono); }
.range { position: relative; height: 6px; border-radius: 6px; background: var(--line); margin: 22px 0 8px; }
.range span { position: absolute; top: -5px; width: 16px; height: 16px; border-radius: 50%; background: var(--accent);
  border: 3px solid var(--surface); transform: translateX(-50%); }
.range-legend { display: flex; justify-content: space-between; font: 13px var(--mono); color: var(--muted); }
.note { font-size: 14px; color: var(--muted); margin: 0; }
.note.warn { color: var(--warn); }

.comps { display: grid; grid-template-columns: 150px 1fr; gap: 18px; align-items: center; }
@media (max-width: 560px) { .comps { grid-template-columns: 1fr; } .comps svg { max-width: 180px; margin: 0 auto; } }
.comps svg { width: 100%; height: auto; }
.comps svg .ring { fill: none; stroke: var(--line); }
.comps svg .me { fill: var(--accent); }
.comps svg .sale { fill: var(--text); opacity: 0.7; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 0 0 8px; }
td { padding: 8px 0; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 13px; }
th:not(:first-child), td:not(:first-child) { text-align: right; padding-left: 10px; }
td { white-space: nowrap; }
@media (max-width: 440px) { th:nth-child(6), td:nth-child(6) { display: none; } td { font-size: 12px; } }
.why { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 2px; }
.why li { display: grid; grid-template-columns: minmax(0, 1fr) 120px 64px; gap: 14px; align-items: center;
  padding: 9px 0; border-top: 1px solid var(--line); }
.why li:first-child { border-top: 0; }
.why .what { min-width: 0; }
.why .what strong { display: block; font-weight: 500; font-size: 14px; }
.why .what span { display: block; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.why .bar { position: relative; height: 6px; background: var(--line); border-radius: 6px; }
.why .bar::before { content: ""; position: absolute; left: 50%; top: -4px; bottom: -4px; width: 1px; background: var(--muted); opacity: 0.5; }
.why .bar i { position: absolute; top: 0; bottom: 0; border-radius: 6px; background: var(--accent); }
.why .bar i.down { background: var(--muted); }
.why .val { font: 500 13px var(--mono); text-align: right; }
.why li.total { border-top: 1px solid var(--text); }
.why li.ref .val, .why li.total .val { font-size: 13px; }
.why li.ref .bar, .why li.total .bar { visibility: hidden; }
@media (max-width: 480px) {
  .why li { grid-template-columns: minmax(0, 1fr) 70px 58px; gap: 10px; }
  .why .what span { white-space: normal; }
}
.trend-stats { display: flex; gap: 32px; margin: 0 0 8px; }
.trend-stats strong { display: block; font: 500 22px var(--mono); letter-spacing: -0.02em; }
.trend-stats strong.up { color: var(--accent); }
.trend { position: relative; margin: 6px 0 10px; }
.trend-svg { display: block; width: 100%; height: auto; overflow: visible; }
.trend-svg .grid { stroke: var(--line); stroke-width: 1; }
.trend-svg .axis { fill: var(--muted); font: 11px var(--mono); }
.trend-svg .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.trend-svg .dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.trend-svg .last { fill: var(--text); font: 500 12px var(--mono); }
.trend-svg .cross { stroke: var(--muted); stroke-width: 1; }
.trend-svg rect:focus { outline: none; }
.trend-svg rect:focus-visible { outline: 2px solid var(--accent); }
.trend-tip { position: absolute; transform: translate(-50%, calc(-100% - 12px)); pointer-events: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12); white-space: nowrap; font-size: 12px; }
.trend-tip strong { display: block; font: 500 13px var(--mono); }
.trend-tip span { color: var(--muted); }
.map { height: 360px; border-radius: 10px; overflow: hidden; background: var(--bg); margin: 4px 0 12px; }
@media (max-width: 480px) { .map { height: 300px; } }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font: 12px var(--mono); color: var(--muted); margin: 0 0 10px; }
.legend .legend-title { width: 100%; font: 500 12px var(--sans); color: var(--text); }
.legend div { display: flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 10px; border-radius: 3px; display: inline-block; }
.maplibregl-popup-content { background: var(--surface) !important; color: var(--text); font: 13px var(--sans);
  border: 1px solid var(--line); border-radius: 8px !important; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15) !important; }
.maplibregl-popup-tip { display: none; }
.maplibregl-ctrl-attrib { font: 11px var(--sans); }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 12px; letter-spacing: -0.01em; }

.prose { padding: 40px 0 0; }
.prose h1 { margin-bottom: 18px; }
.prose h2 { font-size: 18px; margin: 34px 0 10px; }
.prose p, .prose li { color: var(--text); }
.prose .muted { color: var(--muted); }
.prose code { font-family: var(--mono); font-size: 0.9em; background: var(--accent-soft); padding: 1px 5px; border-radius: 5px; }
.prose table { margin: 8px 0; }

footer { margin: 56px 0 40px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted);
  font-size: 13px; display: grid; gap: 6px; }
footer p { margin: 0; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
