/* ============================================================
   RentalAnalytics — Base Styles
   Lightweight, no resets beyond what we need. Mobile-first.
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap");

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }
button { font-family: inherit; cursor: pointer; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.15;
  margin: 0 0 var(--s-4);
}
h1 { font-size: var(--text-3xl); font-weight: 600; }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
p  { margin: 0 0 var(--s-4); color: var(--ink-2); }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.tabular { font-variant-numeric: tabular-nums lining-nums; }
.muted { color: var(--ink-muted); }
.faint { color: var(--ink-faint); }
.small { font-size: var(--text-sm); }
.xs { font-size: var(--text-xs); }

/* Container & layout */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--s-5); }
.container-md { max-width: var(--container-md); margin: 0 auto; padding: 0 var(--s-5); }
.container-sm { max-width: var(--container-sm); margin: 0 auto; padding: 0 var(--s-5); }
.section { padding: var(--s-8) 0; }
.section-sm { padding: var(--s-7) 0; }

/* Grid */
.grid { display: grid; gap: var(--s-5); }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Header / Nav */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(6px);
  background: rgba(255,255,255,0.92);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: var(--s-5);
}
.brand { display: flex; align-items: center; gap: var(--s-3); color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 28px; height: 28px; color: var(--accent); }
.brand-word { font-family: var(--font-display); font-weight: 600; font-size: 19px; letter-spacing: -0.01em; }
.nav-links { display: none; gap: var(--s-5); }
.nav-links a { color: var(--ink-2); font-size: var(--text-sm); font-weight: 500; }
.nav-links a:hover { color: var(--accent); text-decoration: none; }
.nav-cta { display: flex; gap: var(--s-3); align-items: center; }
@media (min-width: 880px) { .nav-links { display: inline-flex; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: 10px 18px; border-radius: var(--r-md);
  font-size: var(--text-sm); font-weight: 600;
  border: 1px solid transparent; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.05s ease;
  line-height: 1;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; text-decoration: none; }
.btn-ghost   { background: transparent; color: var(--ink); border-color: var(--border-2); }
.btn-ghost:hover { background: var(--surface-2); text-decoration: none; }
.btn-lg { padding: 14px 22px; font-size: var(--text-base); }
.btn-sm { padding: 6px 12px; font-size: var(--text-xs); }

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-5);
}
.card-padded { padding: var(--s-6); }
.card h3 { margin-top: 0; }

/* Badge */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--text-xs); font-weight: 600;
  padding: 4px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2);
  border: 1px solid var(--border);
}
.badge-accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge-pro    { background: #efe6f0; color: #6d2876; border-color: transparent; }
.badge-live   { background: #e8f3eb; color: var(--positive); border-color: transparent; }
.badge-live::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--positive); box-shadow: 0 0 0 0 rgba(47,125,58,.55);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(47,125,58,.55); }
  70%  { box-shadow: 0 0 0 8px rgba(47,125,58,0); }
  100% { box-shadow: 0 0 0 0 rgba(47,125,58,0); }
}

/* Forms */
label { display: block; font-size: var(--text-sm); font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.field { margin-bottom: var(--s-4); }
.field-help { font-size: var(--text-xs); color: var(--ink-muted); margin-top: 4px; }
input[type="text"], input[type="number"], input[type="email"], select {
  width: 100%; padding: 10px 12px; font-size: var(--text-base);
  border: 1px solid var(--border-2); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink); font-family: inherit;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Tables */
table.data { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
table.data th, table.data td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
table.data th { font-weight: 600; color: var(--ink); background: var(--surface-2); }
table.data tbody tr:hover { background: var(--surface-2); }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: var(--s-7) 0 var(--s-6);
  margin-top: var(--s-8);
  font-size: var(--text-sm);
  color: var(--ink-muted);
}
.footer-grid { display: grid; gap: var(--s-5); grid-template-columns: 1fr; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; } }
@media (min-width: 1000px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr; } }
.footer-grid h5 { font-family: var(--font-sans); font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); margin: 0 0 var(--s-3); }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 6px; }
.footer-grid a { color: var(--ink-2); }
.footer-bottom { margin-top: var(--s-6); padding-top: var(--s-4); border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: var(--s-4); justify-content: space-between; }

/* Accessibility */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* Utility */
.flex { display: flex; }
.between { justify-content: space-between; }
.center { align-items: center; }
.gap-1 { gap: var(--s-1); }
.gap-2 { gap: var(--s-2); }
.gap-3 { gap: var(--s-3); }
.gap-4 { gap: var(--s-4); }
.gap-5 { gap: var(--s-5); }
.wrap { flex-wrap: wrap; }
.mt-2 { margin-top: var(--s-2); }
.mt-4 { margin-top: var(--s-4); }
.mt-6 { margin-top: var(--s-6); }
.mb-2 { margin-bottom: var(--s-2); }
.mb-4 { margin-bottom: var(--s-4); }
.mb-6 { margin-bottom: var(--s-6); }
.text-center { text-align: center; }

/* Range bar (rent estimator etc.) */
.range-bar { position: relative; height: 14px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.range-bar .fill { position: absolute; top: 0; bottom: 0; background: linear-gradient(90deg, var(--accent-soft), var(--accent)); border-radius: 999px; }
.range-bar .marker { position: absolute; top: -4px; bottom: -4px; width: 3px; background: var(--ink); border-radius: 2px; }

/* KPI tiles */
.kpi { padding: var(--s-5); }
.kpi .label { font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.04em; color: var(--ink-muted); text-transform: uppercase; }
.kpi .value { font-family: var(--font-display); font-size: var(--text-3xl); font-weight: 600; line-height: 1.05; margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.kpi .delta { font-size: var(--text-sm); color: var(--ink-muted); }
.kpi .delta.up { color: var(--positive); }
.kpi .delta.down { color: var(--negative); }

/* Print */
@media print {
  .site-header, .site-footer, .no-print { display: none !important; }
  body { background: #fff; }
  .card { border: 1px solid #ccc; box-shadow: none; }
}
