@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --brand: #2563eb;
  --brand-hover: #1d4ed8;
  --brand-soft: #eff6ff;
  --brand-ink: #1e40af;
  --ok-bg: #ecfdf5;
  --ok-line: #a7f3d0;
  --ok-ink: #065f46;
  --warn-bg: #fffbeb;
  --warn-line: #fcd34d;
  --warn-ink: #92400e;
  --bad-bg: #fff1f2;
  --bad-line: #fecdd3;
  --bad-ink: #9f1239;
  --sky-bg: #f0f9ff;
  --sky-line: #bae6fd;
  --sky-ink: #0c4a6e;
  --sky-label: #0369a1;
  --shadow-sm: 0 1px 2px rgb(15 23 42 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(15 23 42 / 0.08), 0 2px 4px -2px rgb(15 23 42 / 0.06);
  --shadow-lg: 0 10px 15px -3px rgb(15 23 42 / 0.08), 0 4px 6px -4px rgb(15 23 42 / 0.06);
  --shadow-brand: 0 10px 20px -8px rgb(37 99 235 / 0.45);
  --radius: 1rem;
  --radius-sm: 0.625rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 900px 420px at 50% -120px, rgb(37 99 235 / 0.14), transparent 70%),
    radial-gradient(circle at 1px 1px, rgb(148 163 184 / 0.28) 1px, transparent 0);
  background-size: auto, 22px 22px;
  background-attachment: fixed;
}

.container {
  width: min(100% - 2rem, 52rem);
  margin: 0 auto;
  padding: 1.25rem 0 3.5rem;
}

/* Sticky segmented nav */
.site-nav {
  position: sticky;
  top: 0.75rem;
  z-index: 40;
  margin-bottom: 2rem;
  background: rgb(255 255 255 / 0.86);
  border: 1px solid rgb(226 232 240 / 0.95);
  border-radius: 9999px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* Mobile-only chrome — always hidden on desktop */
.site-nav > .nav-top {
  display: none;
}

.nav-current {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--brand-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.35rem;
}

.nav-links a {
  flex: 1 1 auto;
  text-align: center;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 0.65rem 0.9rem;
  border-radius: 9999px;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.nav-links a:hover {
  color: var(--ink);
  background: #f8fafc;
}

.nav-links a[aria-current="page"] {
  color: var(--brand-ink);
  background: var(--brand-soft);
  box-shadow: none;
}

/* Hero header */
header {
  text-align: center;
  padding: 0.5rem 0 1.75rem;
}

header h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: 0.75rem;
}

header p {
  max-width: 34rem;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1.0625rem;
  line-height: 1.6;
}

/* Surfaces */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 0.25rem);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-lg);
}

.card h2 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 1.5rem 0 1rem;
}

.card h2:first-child,
.card > h2:first-of-type {
  margin-top: 0;
}

.card p,
.card li {
  color: #475569;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  line-height: 1.7;
}

.card ul {
  padding-left: 1.15rem;
  margin-bottom: 0.75rem;
}

.card a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}

.card a:hover {
  text-decoration: underline;
}

/* Forms — Tailwind UI field look */
.input-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.input-row label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.45rem;
}

.input-row input,
.input-row select,
.input-row textarea {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  background: #fff;
  box-shadow: inset 0 1px 2px rgb(15 23 42 / 0.03);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  font-family: inherit;
}

.input-row textarea {
  min-height: 9rem;
  resize: vertical;
  font-weight: 400;
}

.input-row input:hover,
.input-row select:hover,
.input-row textarea:hover {
  border-color: #94a3b8;
}

.input-row input:focus,
.input-row select:focus,
.input-row textarea:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 4px rgb(37 99 235 / 0.15);
}

button:not(.nav-toggle) {
  width: 100%;
  padding: 0.9rem 1.1rem;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #3b82f6 0%, var(--brand) 100%);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: var(--shadow-brand);
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
  font-family: inherit;
}

button:not(.nav-toggle):hover {
  filter: brightness(1.05);
  box-shadow: 0 14px 24px -10px rgb(37 99 235 / 0.55);
}

button:not(.nav-toggle):active {
  transform: translateY(1px);
}

button:not(.nav-toggle):focus-visible {
  outline: none;
  box-shadow: var(--shadow-brand), 0 0 0 4px rgb(37 99 235 / 0.2);
}

/* Hamburger control — after global button rules so it never inherits CTA styles */
.site-nav .nav-toggle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0.75rem;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font: inherit;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
  filter: none;
  transform: none;
  transition: background 0.15s ease;
}

.site-nav .nav-toggle:hover {
  background: #dbeafe;
  filter: none;
  box-shadow: none;
}

.site-nav .nav-toggle:active {
  transform: none;
}

.site-nav .nav-toggle:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  box-shadow: none;
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 1.125rem;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle-bars {
  position: relative;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-bars::before {
  top: -6px;
}

.nav-toggle-bars::after {
  top: 6px;
}

.site-nav.is-open .nav-toggle-bars {
  background: transparent;
}

.site-nav.is-open .nav-toggle-bars::before {
  top: 0;
  transform: rotate(45deg);
}

.site-nav.is-open .nav-toggle-bars::after {
  top: 0;
  transform: rotate(-45deg);
}

/* Results */
.results {
  display: none;
}

.results.show {
  display: block;
  animation: rise 0.28s ease;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.result-box {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #f8fbff 0%, var(--sky-bg) 100%);
  border: 1px solid var(--sky-line);
  border-radius: var(--radius);
  padding: 1.15rem 1rem 1.05rem;
  text-align: left;
}

.result-box::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #0ea5e9;
}

.result-box .label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sky-label);
  margin-bottom: 0.45rem;
}

.result-box .value {
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--sky-ink);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.result-box.green {
  background: linear-gradient(180deg, #f6fffb 0%, var(--ok-bg) 100%);
  border-color: var(--ok-line);
}

.result-box.green::before {
  background: #10b981;
}

.result-box.green .label {
  color: #047857;
}

.result-box.green .value {
  color: var(--ok-ink);
}

.result-box.red {
  background: linear-gradient(180deg, #fff8f8 0%, var(--bad-bg) 100%);
  border-color: var(--bad-line);
}

.result-box.red::before {
  background: #f43f5e;
}

.result-box.red .label,
.result-box.red .value {
  color: var(--bad-ink);
}

.result-box.blue {
  background: linear-gradient(180deg, #f8fbff 0%, var(--brand-soft) 100%);
  border-color: #bfdbfe;
}

.result-box.blue::before {
  background: var(--brand);
}

.result-box.blue .label,
.result-box.blue .value {
  color: var(--brand-ink);
}

/* Tables */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

th {
  text-align: left;
  padding: 0.85rem 0.9rem;
  background: #f8fafc;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--line);
}

td {
  padding: 0.85rem 0.9rem;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: #f8fafc;
}

/* Content / FAQ */
.content h2 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 0.25rem 0 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--line);
}

.content h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin: 1.35rem 0 0.45rem;
}

.content p,
.content li {
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.75;
  margin-bottom: 0.8rem;
}

.content ul {
  padding-left: 1.15rem;
  margin-bottom: 0.75rem;
}

.content a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}

.content a:hover {
  text-decoration: underline;
}

/* Disclaimer */
.disclaimer {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: var(--radius);
  padding: 0.95rem 1.05rem;
  color: var(--warn-ink);
  font-size: 0.875rem;
  line-height: 1.55;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.disclaimer::before {
  content: "!";
  flex: 0 0 auto;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 9999px;
  background: #f59e0b;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  margin-top: 0.1rem;
}

/* Affordability bars */
.breakdown {
  margin-top: 0.5rem;
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.breakdown p {
  font-size: 0.875rem;
  color: #475569;
}

.bar {
  height: 0.65rem;
  background: #e2e8f0;
  border-radius: 9999px;
  margin: 0.55rem 0 0.85rem;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.25s ease;
}

.bar-fill.ok { background: linear-gradient(90deg, #34d399, #059669); }
.bar-fill.warn { background: linear-gradient(90deg, #fbbf24, #d97706); }
.bar-fill.bad { background: linear-gradient(90deg, #fb7185, #e11d48); }

/* Verdict */
.verdict {
  padding: 1rem 1.15rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  line-height: 1.65;
  margin-top: 0.35rem;
  font-weight: 500;
}

.verdict.buy {
  background: var(--ok-bg);
  border: 1px solid var(--ok-line);
  color: var(--ok-ink);
}

.verdict.rent {
  background: var(--brand-soft);
  border: 1px solid #bfdbfe;
  color: var(--brand-ink);
}

.note {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.85rem;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 2.25rem 0 0.5rem;
  color: #94a3b8;
  font-size: 0.8125rem;
}

.site-footer .links {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.3rem;
  margin-bottom: 0.9rem;
  background: rgb(255 255 255 / 0.8);
  border: 1px solid var(--line);
  border-radius: 9999px;
  box-shadow: var(--shadow-sm);
}

.site-footer a {
  color: #475569;
  text-decoration: none;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
}

.site-footer a:hover {
  color: var(--brand);
  background: var(--brand-soft);
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 1.25rem, 52rem);
  }

  .site-nav {
    border-radius: 1rem;
    overflow: hidden;
  }

  .site-nav > .nav-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.4rem 0.4rem 0.4rem 1rem;
  }

  .site-nav > .nav-links {
    display: none;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0 0.4rem 0.4rem;
  }

  .site-nav.is-open > .nav-links {
    display: flex;
  }

  .site-nav > .nav-links a {
    flex: none;
    text-align: left;
    font-size: 0.875rem;
    padding: 0.75rem 0.9rem;
    border-radius: 0.75rem;
  }

  .card {
    padding: 1.15rem;
  }
}
