:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-soft: #eef2f7;
  --text: #172033;
  --muted: #5f6b7d;
  --line: #d9e0ea;
  --brand: #165dff;
  --brand-dark: #0d3fbd;
  --accent: #0f9f7f;
  --warning: #b45309;
  --danger: #b42318;
  --success: #067647;
  --max: 1180px;
  --shadow: 0 18px 45px rgba(22, 36, 64, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--brand-dark); text-underline-offset: 3px; }
a:hover { color: var(--brand); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  padding: .75rem 1rem;
  background: var(--text);
  color: #fff;
  z-index: 9999;
}
.skip-link:focus { left: .75rem; top: .75rem; }

.container { width: min(calc(100% - 2rem), var(--max)); margin-inline: auto; }
.narrow { width: min(calc(100% - 2rem), 820px); margin-inline: auto; }
.section { padding: 5rem 0; }
.section-sm { padding: 3rem 0; }
.section-title { margin: 0 0 .75rem; font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1.12; letter-spacing: -.03em; }
.section-lead { max-width: 720px; margin: 0 0 2.25rem; color: var(--muted); font-size: 1.08rem; }
.eyebrow { display: inline-flex; align-items: center; gap: .45rem; margin-bottom: .8rem; color: var(--brand-dark); font-weight: 750; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--brand); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.header-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; }
.brand { display: inline-flex; align-items: center; gap: .75rem; color: var(--text); text-decoration: none; font-weight: 850; letter-spacing: -.02em; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid #bfd0ff; background: #e9efff; color: var(--brand-dark); }
.brand-mark svg { width: 22px; height: 22px; }
.nav { display: flex; align-items: center; gap: 1.4rem; }
.nav a { color: var(--text); text-decoration: none; font-weight: 650; font-size: .95rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--brand); }
.nav-cta { padding: .7rem 1rem; border: 1px solid var(--brand); background: var(--brand); color: #fff !important; }
.nav-toggle { display: none; width: 42px; height: 42px; border: 1px solid var(--line); background: #fff; color: var(--text); }

.hero { overflow: hidden; background: linear-gradient(180deg, #fff 0%, #f3f6fb 100%); border-bottom: 1px solid var(--line); }
.hero-grid { min-height: 620px; display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 4rem; }
.hero h1 { margin: 0 0 1.2rem; font-size: clamp(2.65rem, 6vw, 5.5rem); line-height: .98; letter-spacing: -.055em; max-width: 780px; }
.hero p { max-width: 660px; margin: 0 0 2rem; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.28rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .85rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 46px; padding: .78rem 1.1rem; border: 1px solid transparent; text-decoration: none; font-weight: 750; transition: .2s ease; }
.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-secondary { background: #fff; color: var(--text); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--brand); color: var(--brand); }
.btn-small { min-height: 38px; padding: .52rem .8rem; font-size: .9rem; }

.hero-visual { position: relative; min-height: 440px; }
.hero-panel { position: absolute; inset: 40px 0 20px 40px; background: var(--text); color: #fff; padding: 2rem; box-shadow: var(--shadow); }
.hero-panel::before { content: ""; position: absolute; inset: -20px 30px 30px -20px; border: 1px solid #9eb8ff; z-index: -1; }
.hero-panel h2 { margin: 0; font-size: 1rem; font-weight: 700; color: #bfd0ff; }
.hero-number { margin: .45rem 0 .25rem; font-size: clamp(3rem, 7vw, 5rem); font-weight: 850; letter-spacing: -.05em; }
.hero-panel p { margin: 0 0 1.6rem; color: #c8d1df; font-size: .95rem; }
.mini-bars { display: grid; gap: .9rem; }
.mini-bar-row { display: grid; grid-template-columns: 105px 1fr 52px; align-items: center; gap: .75rem; font-size: .85rem; }
.mini-track { height: 9px; background: #344056; }
.mini-fill { height: 100%; background: #73a0ff; }
.source-note { margin-top: 1.4rem; color: #aeb9c9; font-size: .78rem; }

.stats-strip { border-bottom: 1px solid var(--line); background: #fff; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 1.6rem 1.5rem; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat strong { display: block; font-size: 1.75rem; letter-spacing: -.03em; }
.stat span { color: var(--muted); font-size: .9rem; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.card { background: var(--surface); border: 1px solid var(--line); padding: 1.35rem; }
.card:hover { border-color: #aac0ff; }
.card h3 { margin: .55rem 0 .55rem; font-size: 1.25rem; line-height: 1.25; }
.card p { margin: 0; color: var(--muted); }
.card-link { display: inline-flex; margin-top: 1rem; font-weight: 750; text-decoration: none; }
.icon-box { width: 42px; height: 42px; display: grid; place-items: center; background: #eaf0ff; color: var(--brand-dark); border: 1px solid #c7d6ff; }
.icon-box svg { width: 22px; height: 22px; }
.tag { display: inline-flex; padding: .24rem .48rem; border: 1px solid var(--line); background: var(--surface-soft); color: var(--muted); font-size: .78rem; font-weight: 700; }

.feature-split { display: grid; grid-template-columns: .9fr 1.1fr; gap: 3rem; align-items: start; }
.feature-list { display: grid; gap: 1rem; }
.feature-item { display: grid; grid-template-columns: 46px 1fr; gap: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.feature-item:last-child { border-bottom: 0; }
.feature-item h3 { margin: 0 0 .25rem; }
.feature-item p { margin: 0; color: var(--muted); }
.number-badge { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid #bdd0ff; color: var(--brand-dark); font-weight: 850; background: #edf2ff; }

.page-hero { padding: 4.8rem 0 3.7rem; background: #fff; border-bottom: 1px solid var(--line); }
.page-hero h1 { max-width: 920px; margin: 0 0 1rem; font-size: clamp(2.4rem, 6vw, 4.8rem); line-height: 1.02; letter-spacing: -.045em; }
.page-hero p { max-width: 760px; margin: 0; color: var(--muted); font-size: 1.12rem; }
.breadcrumbs { margin-bottom: 1.25rem; color: var(--muted); font-size: .88rem; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }

.content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 3rem; align-items: start; min-width: 0; }
.content-layout > * { min-width: 0; }
.article { background: #fff; border: 1px solid var(--line); padding: clamp(1.4rem, 4vw, 3rem); }
.article h2 { margin-top: 2.3rem; line-height: 1.2; letter-spacing: -.02em; }
.article h3 { margin-top: 1.6rem; line-height: 1.28; }
.article p, .article li { color: #354156; }
.article ul, .article ol { padding-left: 1.35rem; }
.article table { width: 100%; border-collapse: collapse; margin: 1.3rem 0; table-layout: fixed; }
.article th, .article td { overflow-wrap: anywhere; }
.article th, .article td { padding: .75rem; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.article th { background: var(--surface-soft); }
.article-meta { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; margin: 1.25rem 0 2rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.lede { font-size: 1.15rem; color: #2f3c50 !important; }
.callout { margin: 1.5rem 0; padding: 1.1rem 1.2rem; border-left: 4px solid var(--brand); background: #edf3ff; }
.callout strong { display: block; margin-bottom: .25rem; }
.warning { border-left-color: var(--warning); background: #fff7ed; }
.source-box { margin-top: 2.5rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.source-box h2 { margin-top: 0; font-size: 1.3rem; }
.source-box ol { margin-bottom: 0; }
.faq-list details { border-top: 1px solid var(--line); padding: 1rem 0; }
.faq-list summary { cursor: pointer; font-weight: 750; }
.faq-list p { margin-bottom: 0; }

.sidebar { display: grid; gap: 1rem; position: sticky; top: 92px; }
.sidebar-box { padding: 1.2rem; background: #fff; border: 1px solid var(--line); }
.sidebar-box h3 { margin-top: 0; }
.sidebar-box ul { margin: 0; padding-left: 1.15rem; }
.sidebar-box li { margin-bottom: .5rem; }

.calculator-wrap { display: grid; grid-template-columns: 1fr .9fr; gap: 1.4rem; align-items: start; }
.calc-panel { background: #fff; border: 1px solid var(--line); padding: 1.4rem; }
.calc-panel h2 { margin-top: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.field { display: grid; gap: .4rem; }
.field.full { grid-column: 1 / -1; }
.field label { font-weight: 700; font-size: .92rem; }
.field small { color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; border: 1px solid #c9d2df; background: #fff; color: var(--text); padding: .78rem .85rem; min-height: 46px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid rgba(22,93,255,.16); border-color: var(--brand); }
.form-actions { margin-top: 1rem; display: flex; gap: .75rem; flex-wrap: wrap; }
.result-panel { background: var(--text); color: #fff; border: 1px solid var(--text); padding: 1.5rem; min-height: 320px; }
.result-panel h2 { margin-top: 0; color: #d9e3ff; font-size: 1rem; }
.result-primary { margin: .4rem 0; font-size: clamp(2.3rem, 6vw, 4rem); font-weight: 850; letter-spacing: -.05em; }
.result-sub { margin: 0 0 1.4rem; color: #c7d0dd; }
.result-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.result-stat { padding: .85rem; border: 1px solid #3a465a; background: #202b3e; }
.result-stat span { display: block; color: #aeb8c7; font-size: .82rem; }
.result-stat strong { font-size: 1.2rem; }
.result-note { margin-top: 1rem; color: #adb8c7; font-size: .82rem; }
.progress { height: 10px; background: #344158; margin: .5rem 0 1rem; }
.progress > span { display: block; height: 100%; background: #77a3ff; }

.city-score { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); background: #fff; }
.city-score > div { padding: 1.2rem; border-right: 1px solid var(--line); }
.city-score > div:last-child { border-right: 0; }
.city-score strong { display: block; font-size: 1.9rem; }
.city-score span { color: var(--muted); font-size: .86rem; }

.notice { padding: 1rem 1.2rem; background: #fff; border: 1px solid var(--line); color: var(--muted); }
.notice strong { color: var(--text); }

.search-wrap { display: grid; gap: 1rem; }
.search-input { width: 100%; min-height: 54px; padding: .9rem 1rem; border: 1px solid var(--line); background: #fff; }
.search-results { display: grid; gap: .75rem; }
.search-result { background: #fff; border: 1px solid var(--line); padding: 1rem; }
.search-result h3 { margin: 0 0 .3rem; }
.search-result p { margin: 0; color: var(--muted); }

.cta-band { background: var(--text); color: #fff; }
.cta-band .container { display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.cta-band h2 { margin: 0; font-size: clamp(1.7rem, 4vw, 2.8rem); letter-spacing: -.03em; }
.cta-band p { color: #c8d0db; margin-bottom: 0; }

.site-footer { background: #0f1726; color: #d4d9e2; padding: 4rem 0 1.6rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 2rem; }
.footer-grid h3 { color: #fff; margin-top: 0; font-size: 1rem; }
.footer-grid a { color: #c5cedb; text-decoration: none; }
.footer-grid a:hover { color: #fff; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: .55rem; }
.footer-note { max-width: 420px; color: #9ea9b9; }
.footer-bottom { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid #2c3547; color: #98a3b4; font-size: .86rem; }

.cookie-placeholder { display: none; position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 80; max-width: 760px; margin: auto; padding: 1rem; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
.cookie-placeholder.is-visible { display: block; }
.cookie-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .75rem; }

@media (max-width: 980px) {
  .hero-grid, .feature-split, .calculator-wrap { grid-template-columns: 1fr; }
  .content-layout { grid-template-columns: minmax(0, 1fr); }
  .hero-grid { padding: 4rem 0; min-height: auto; }
  .hero-visual { min-height: 390px; }
  .sidebar { position: static; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .footer-grid > div:last-child { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .nav-toggle { display: inline-grid; place-items: center; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 72px; padding: 1rem; background: #fff; border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; }
  .nav.is-open { display: flex; }
  .nav a { padding: .7rem .2rem; }
  .grid-2, .grid-3, .grid-4, .form-grid, .result-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .section { padding: 3.7rem 0; }
  .page-hero { padding: 3.6rem 0 2.8rem; }
  .hero-panel { inset: 20px 0 15px 18px; padding: 1.3rem; }
  .mini-bar-row { grid-template-columns: 86px 1fr 46px; }
  .city-score { grid-template-columns: 1fr; }
  .city-score > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .city-score > div:last-child { border-bottom: 0; }
  .cta-band .container { display: grid; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > div:first-child, .footer-grid > div:last-child { grid-column: 1 / -1; }
  .footer-bottom { display: grid; }
}

@media (max-width: 520px) {
  .container, .narrow { width: min(calc(100% - 1.2rem), var(--max)); }
  .hero h1 { font-size: 2.65rem; }
  .stats-grid { grid-template-columns: 1fr; }
  .stat { border-right: 0; border-bottom: 1px solid var(--line); }
  .stat:last-child { border-bottom: 0; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-grid > div { grid-column: auto !important; }
  .article, .calc-panel, .result-panel { padding: 1rem; }
}
