:root {
  --ink: #111827;
  --muted: #64748b;
  --paper: #f7f5f0;
  --white: #fff;
  --accent: #ff5b35;
  --accent-dark: #d93d1c;
  --blue: #134e8e;
  --line: #dedbd3;
  --shadow: 0 22px 60px rgba(24, 34, 45, .10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
button { font: inherit; }
.wrap { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }

.hero {
  color: #fff;
  background:
    radial-gradient(circle at 84% 20%, rgba(255, 91, 53, .34), transparent 25%),
    linear-gradient(135deg, #111827 0%, #17365d 64%, #134e8e 100%);
  overflow: hidden;
  position: relative;
}
.hero::after {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  right: -230px;
  bottom: -340px;
  border: 100px solid rgba(255,255,255,.05);
  border-radius: 50%;
}
.hero__inner { min-height: 430px; padding-block: 76px 68px; display: flex; align-items: flex-end; justify-content: space-between; gap: 56px; position: relative; z-index: 1; }
.eyebrow, .section-kicker { margin: 0 0 10px; text-transform: uppercase; letter-spacing: .16em; font-size: 12px; font-weight: 800; }
.eyebrow { color: #ffb29f; }
h1 { margin: 0; max-width: 820px; font-size: clamp(42px, 6.8vw, 84px); line-height: .97; letter-spacing: -.055em; }
h1 span { color: #ff8a6f; }
.hero__lead { max-width: 690px; margin: 28px 0 0; color: #ced9e8; font-size: 18px; }
.hero__stamp { min-width: 180px; padding: 20px 22px; border: 1px solid rgba(255,255,255,.24); border-radius: 16px; background: rgba(255,255,255,.07); backdrop-filter: blur(10px); }
.hero__stamp span, .hero__stamp strong { display: block; }
.hero__stamp span { color: #b8c7da; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.hero__stamp strong { margin-top: 4px; font-size: 22px; }

main { padding-block: 54px 86px; }
h2 { margin: 0; font-size: clamp(25px, 3.5vw, 38px); line-height: 1.1; letter-spacing: -.035em; }
.section-kicker { color: var(--accent-dark); }
.controls { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; margin-bottom: 30px; }
.room-tabs { display: flex; gap: 6px; padding: 6px; background: #e9e6df; border-radius: 14px; overflow-x: auto; }
.room-tabs button { border: 0; white-space: nowrap; padding: 11px 17px; border-radius: 10px; background: transparent; color: #526071; cursor: pointer; font-weight: 700; transition: .2s ease; }
.room-tabs button:hover { color: var(--ink); }
.room-tabs button.is-active { color: white; background: var(--ink); box-shadow: 0 5px 14px rgba(17,24,39,.2); }

.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.metric { position: relative; min-height: 154px; padding: 24px; border: 1px solid var(--line); background: rgba(255,255,255,.7); border-radius: 18px; overflow: hidden; }
.metric__icon { position: absolute; right: 18px; top: 14px; color: #d8d4cb; font-size: 44px; font-weight: 300; }
.metric p { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.metric strong, .metric small { display: block; }
.metric strong { font-size: 25px; line-height: 1.1; letter-spacing: -.02em; }
.metric small { margin-top: 7px; color: var(--muted); }

.dashboard { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(310px, .75fr); gap: 16px; align-items: stretch; }
.map-card, .detail-card, .ranking { background: var(--white); border-radius: 22px; box-shadow: var(--shadow); }
.map-card { padding: 28px; }
.card-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; }
.legend { display: grid; grid-template-columns: auto 94px auto; gap: 8px; align-items: center; color: var(--muted); font-size: 11px; }
.legend i { display: block; height: 7px; border-radius: 9px; background: linear-gradient(90deg, #bee3f8, #ffd0b9, #f04438); }
.map-wrap { margin-top: 16px; }
.district-map { display: block; width: 100%; max-height: 610px; }
.map-grid path { stroke: #edf0f3; stroke-width: 1; fill: none; }
.districts path { stroke: white; stroke-width: 8; stroke-linejoin: round; cursor: pointer; transition: filter .2s, opacity .2s, stroke-width .2s; outline: none; }
.districts path:hover, .districts path:focus { filter: brightness(.93); stroke-width: 12; }
.districts path.is-active { stroke: var(--ink); stroke-width: 11; filter: saturate(1.18); }
.map-labels { pointer-events: none; text-anchor: middle; dominant-baseline: middle; fill: #172033; font-weight: 800; font-size: 19px; paint-order: stroke; stroke: rgba(255,255,255,.85); stroke-width: 4px; stroke-linejoin: round; }
.map-labels tspan + tspan { font-size: 16px; fill: #304052; }
.map-note { margin: 6px 0 0; color: #8993a0; font-size: 11px; }

.detail-card { color: white; padding: 29px; background: linear-gradient(165deg, #19263a 0%, #111827 70%); display: flex; flex-direction: column; }
.detail-card .section-kicker { color: #ff9278; }
.detail-card h2 { font-size: 35px; overflow-wrap: anywhere; }
.detail-card__insight { margin: 17px 0 0; color: #c9d2df; font-size: 15px; }
.price-focus { padding: 25px 0; margin: 25px 0 20px; border-top: 1px solid rgba(255,255,255,.15); border-bottom: 1px solid rgba(255,255,255,.15); }
.price-focus span, .price-focus small, .price-focus strong { display: block; }
.price-focus span { color: #ff9278; font-size: 13px; font-weight: 800; }
.price-focus strong { margin: 6px 0 0; font-size: clamp(28px, 3vw, 40px); line-height: 1; letter-spacing: -.04em; }
.price-focus small { margin-top: 8px; color: #99a6b8; }
.all-prices { display: grid; gap: 9px; }
.all-price { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: #aeb9c8; font-size: 13px; }
.all-price b { color: white; font-size: 14px; }
.all-price.is-active { color: #ff9278; }
.all-price.is-active b { color: #ff9278; }
.next-district { margin-top: auto; padding: 16px 0 4px; color: white; background: transparent; border: 0; text-align: left; font-weight: 800; cursor: pointer; }
.next-district span { float: right; color: #ff9278; font-size: 22px; transition: transform .2s; }
.next-district:hover span { transform: translateX(5px); }

.ranking { margin-top: 16px; padding: 30px; }
.ranking__hint { color: var(--muted); font-size: 13px; margin: 0; }
.ranking-list { margin-top: 30px; display: grid; gap: 13px; }
.rank-row { display: grid; grid-template-columns: minmax(130px, 210px) 1fr 115px; gap: 16px; align-items: center; border: 0; background: transparent; padding: 4px 0; color: inherit; text-align: left; cursor: pointer; }
.rank-row:hover .rank-name { color: var(--accent-dark); }
.rank-name { font-weight: 800; transition: color .2s; }
.rank-track { position: relative; height: 13px; border-radius: 10px; background: #eeece7; }
.rank-range { position: absolute; top: 0; height: 100%; min-width: 8px; border-radius: 10px; background: linear-gradient(90deg, #ffb394, var(--accent)); box-shadow: 0 3px 10px rgba(255,91,53,.22); }
.rank-value { text-align: right; font-weight: 800; font-size: 14px; }

.guide { margin-top: 76px; }
.guide > h2 { max-width: 600px; }
.guide-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 27px; }
.guide-grid > div { padding: 24px 0; border-top: 2px solid var(--ink); }
.guide-grid b { display: block; margin-bottom: 38px; color: var(--accent-dark); font-size: 13px; }
.guide-grid strong { font-size: 19px; }
.guide-grid p { margin: 9px 0 0; color: var(--muted); font-size: 14px; }

footer { padding: 34px 0; color: #ccd4df; background: #111827; }
.footer__inner { display: grid; grid-template-columns: 1.3fr .7fr; gap: 40px; }
footer strong { color: white; }
footer p { margin: 8px 0 0; font-size: 13px; }
.footer__note { color: #8e9bad; }

@media (max-width: 900px) {
  .hero__inner { min-height: auto; padding-block: 58px; align-items: flex-start; flex-direction: column; }
  .hero__stamp { min-width: 0; }
  .controls { align-items: flex-start; flex-direction: column; }
  .room-tabs { width: 100%; }
  .summary { grid-template-columns: 1fr; }
  .metric { min-height: 125px; }
  .dashboard { grid-template-columns: 1fr; }
  .detail-card { min-height: 510px; }
}

@media (max-width: 620px) {
  .wrap { width: min(100% - 24px, 1180px); }
  .hero__inner { padding-block: 44px 48px; gap: 30px; }
  h1 { font-size: clamp(36px, 10.3vw, 42px); letter-spacing: -.06em; }
  .hero__lead { font-size: 16px; }
  main { padding-block: 36px 60px; }
  .room-tabs { display: grid; grid-template-columns: 1fr 1fr; overflow: visible; }
  .room-tabs button { padding-inline: 10px; }
  .map-card, .detail-card, .ranking { border-radius: 17px; }
  .map-card, .detail-card, .ranking { padding: 20px; }
  .card-heading { align-items: flex-start; flex-direction: column; }
  .legend { align-self: stretch; grid-template-columns: auto 1fr auto; }
  .map-labels { font-size: 15px; stroke-width: 3px; }
  .map-labels tspan + tspan { font-size: 14px; }
  .districts path { stroke-width: 6; }
  .rank-row { grid-template-columns: 1fr auto; gap: 4px 12px; }
  .rank-track { grid-column: 1 / -1; grid-row: 2; }
  .rank-value { grid-column: 2; grid-row: 1; }
  .guide-grid, .footer__inner { grid-template-columns: 1fr; }
  .guide-grid b { margin-bottom: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
