/* Nafas map: quiet editorial framing, high-contrast data, native controls. */
:root {
  --paper: #11151b;
  --surface: #1b212a;
  --ink: #f1f0ed;
  --muted: #b6beca;
  --line: #394350;
  --accent: #f29aa5;
  --accent-hover: #ffd0d5;
  --tint: #34222b;
  --control: #151a22;
  --control-border: #788594;
  --selected: #303b49;
  --map: #101a21;
  --map-muted: #b5c3cd;
  --map-border: #40515d;
  --focus: #8ccdf0;
  --radius: 18px;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Vazirmatn, Tahoma, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}
a {
  color: inherit;
  text-underline-offset: 4px;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button,
select {
  cursor: pointer;
}
button {
  color: inherit;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button:active {
  filter: brightness(0.92);
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}
button,
input,
select,
a {
  touch-action: manipulation;
}
a,
button {
  transition:
    background 0.16s,
    color 0.16s,
    border-color 0.16s;
}
svg {
  max-width: 100%;
}
p,
h1,
h2,
h3 {
  margin-top: 0;
}
h1,
h2,
h3 {
  line-height: 1.3;
  text-wrap: balance;
}
h2 {
  font-size: 20px;
}
h3 {
  font-size: 18px;
}
small {
  display: block;
}
.site-header {
  max-width: 1440px;
  margin: auto;
  padding: 24px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}
.brand {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  text-decoration: none;
  font-size: 20px;
}
.brand small {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.13em;
  font-weight: 400;
}
.brand-logo {
  display: block;
  flex-shrink: 0;
  width: 88px;
  height: 58px;
  object-fit: contain;
  padding: 4px;
  background: #fff;
  border-radius: 8px;
}
.site-header nav {
  display: flex;
  align-items: center;
  gap: 24px;
}
.home-link {
  font-size: 13px;
}
.languages {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border-radius: 9px;
  padding: 4px;
  direction: ltr;
}
.languages a {
  min-height: 44px;
  min-width: 68px;
  display: grid;
  place-items: center;
  padding: 8px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
}
.languages a[aria-current] {
  background: var(--selected);
  box-shadow: 0 1px 4px #0003;
  color: var(--accent);
  font-weight: 700;
}
.languages a:hover {
  background: var(--selected);
}
.overview,
.workspace,
.stats,
.no-script {
  max-width: 1360px;
  margin-inline: auto;
}
.overview {
  padding: 36px 0 24px;
}
.intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 10px;
}
.year {
  margin-inline-start: 10px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  letter-spacing: 0;
  color: var(--muted);
}
h1 {
  font-size: clamp(32px, 3.4vw, 48px);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}
.intro-copy {
  color: var(--muted);
  max-width: 660px;
  margin-bottom: 24px;
}
.text-link {
  font-size: 14px;
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.metrics {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr 1fr;
  margin: 8px 0 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.metric {
  padding: 20px 28px;
  display: flex;
  flex-direction: column-reverse;
  gap: 4px;
  border-inline-start: 1px solid var(--line);
}
.metric:first-child {
  border: 0;
}
.metric dt {
  font-size: 14px;
  color: var(--muted);
}
.metric dd {
  margin: 0;
  font-size: 38px;
  font-weight: 600;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.025em;
}
.metric.primary {
  background: var(--tint);
}
.metric.primary dd {
  color: var(--accent);
}
.snapshot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}
.snapshot a {
  color: var(--accent);
  padding: 8px 0;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.snapshot > span {
  align-self: center;
}
.workspace {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  align-items: stretch;
}
.explorer {
  --explorer-gutter: 24px;
  min-width: 0;
  border-inline-end: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.filters {
  padding: 24px var(--explorer-gutter) 12px;
}
.filters h2 {
  margin-bottom: 20px;
}
.filters label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin: 16px 0 6px;
}
.filters input,
.filters select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--control-border);
  background: var(--control);
  border-radius: 8px;
  color: var(--ink);
  padding: 10px 12px;
  font-size: 16px;
}
.filters input::placeholder {
  color: var(--muted);
  font-size: 13px;
}
.select-control {
  position: relative;
}
.select-control select {
  -webkit-appearance: none;
  appearance: none;
  padding-inline-end: 44px;
}
.select-arrow {
  position: absolute;
  inset-inline-end: 16px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
#citySearch {
  scroll-margin-top: 48px;
}
.clear {
  border: 0;
  background: none;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
  min-height: 44px;
  padding: 8px 0;
  font-size: 13px;
}
.clear:hover {
  color: var(--accent-hover);
}
.result-summary {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  padding: 12px var(--explorer-gutter);
  border-block: 1px solid var(--line);
  background: var(--control);
}
.result-summary b {
  color: var(--ink);
}
.city-list {
  max-height: 368px;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 4px 8px;
  scrollbar-width: thin;
}
.city-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 4rem 20px;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 12px calc(var(--explorer-gutter) - 8px);
  text-align: start;
  border-radius: 6px;
}
.city-row:last-child {
  border-bottom: 0;
}
.city-row:focus-visible {
  outline-offset: -3px;
}
.city-row:hover,
.city-row.selected {
  background: var(--tint);
}
.city-row strong {
  font-size: 14px;
  font-weight: 600;
}
.city-row > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
.city-row small {
  font-size: 12px;
  color: var(--muted);
}
.city-row .count {
  text-align: end;
  font-size: 20px;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.city-row .arrow {
  display: block;
  width: 20px;
  height: 20px;
  color: var(--muted);
}
.empty {
  padding: 24px var(--explorer-gutter);
  color: var(--muted);
}
.map-card {
  background: var(--map);
  color: #f3f4f5;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.map-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 24px 0;
}
.map-heading h2 {
  font-size: 15px;
  font-weight: 500;
  margin: 0;
}
.map-heading a {
  font-size: 12px;
  color: var(--map-muted);
  min-height: 44px;
  display: flex;
  align-items: center;
}
#app {
  position: relative;
  height: 490px;
  min-width: 0;
  overflow: hidden;
  flex: 1;
}
#map {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: pan-y;
  background: var(--map);
}
#map:active {
  cursor: grabbing;
}
.sea {
  fill: #152833;
}
.land {
  fill: #18232b;
  stroke: none;
}
.province {
  stroke: #82949f;
  stroke-width: 0.65;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  transition:
    stroke 0.18s,
    filter 0.18s;
}
.province:hover,
.province.active {
  stroke: #fff;
  stroke-width: 1.8;
  filter: brightness(1.12);
}
.counties {
  pointer-events: none;
}
.county {
  fill: none;
  stroke: #8ea0aa;
  stroke-opacity: 0.4;
  stroke-width: 0.4;
  vector-effect: non-scaling-stroke;
}
.bubble {
  fill: #ffbeb3;
  fill-opacity: 0.82;
  stroke: #3b1d26;
  stroke-width: 1;
  cursor: pointer;
}
.bubble-hit {
  fill: transparent;
  cursor: pointer;
}
.bubble.selected {
  stroke: #fff;
  stroke-width: 3;
}
.bubble.dimmed {
  opacity: 0.15;
}
.plabel,
.blabel {
  pointer-events: none;
  fill: #fff;
  font-size: 11px;
  paint-order: stroke;
  stroke: #15202a;
  stroke-width: 3px;
  stroke-linejoin: round;
}
.blabel {
  font-size: 12px;
  font-weight: 600;
}
.zoomctl {
  position: absolute;
  inset-inline-end: 16px;
  top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.zoomctl button {
  width: 44px;
  height: 44px;
  border: 1px solid #778a96;
  border-radius: 8px;
  background: #16252f;
  color: white;
  font-size: 23px;
  display: grid;
  place-items: center;
}
.zoomctl button:hover {
  background: #3d4d59;
}
.zoomctl :focus-visible {
  outline-color: #ffd2bd;
}
.maphint {
  position: absolute;
  bottom: 0;
  inset-inline: 12px;
  text-align: center;
  font-size: 11px;
  color: var(--map-muted);
  pointer-events: none;
}
.map-key {
  border-top: 1px solid var(--map-border);
  margin: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 0 8px;
  font-size: 11px;
  color: var(--map-muted);
}
.gradient-key {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  direction: ltr;
}
.gradient-key i {
  display: block;
  width: 115px;
  height: 7px;
  border-radius: 4px;
  background: #793c49;
}
.gradient-key b {
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.bubble-key {
  display: flex;
  gap: 8px;
  align-items: center;
  max-width: 200px;
}
.bubble-key svg {
  flex-shrink: 0;
  fill: #ffbeb3;
  stroke: #fff;
  stroke-width: 0.5;
}
.coverage {
  margin: 4px 24px;
  font-size: 11px;
  color: var(--map-muted);
}
.credit {
  margin: 4px 24px 16px;
  font-size: 10px;
  color: var(--map-muted);
}
.map-status {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 64px;
  background: #101a21e8;
  font-size: 15px;
}
.map-status button {
  padding: 10px 18px;
  border: 1px solid var(--control-border);
  background: var(--surface);
  color: var(--ink);
  border-radius: 8px;
  min-height: 44px;
}
.detail {
  padding: 12px var(--explorer-gutter) 24px;
  max-height: 460px;
  overflow: auto;
  overflow-wrap: anywhere;
}
.close-detail {
  background: none;
  border: 0;
  color: var(--accent);
  min-height: 44px;
  padding: 8px 0;
  font-size: 13px;
}
.detail h3 {
  font-size: 26px;
  margin-bottom: 4px;
}
.detail-total {
  font-size: 40px;
  color: var(--accent);
  font-weight: 700;
  margin: 12px 0;
}
.detail-total small {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}
.detail-sub {
  font-size: 13px;
  color: var(--muted);
}
.breakdown {
  list-style: none;
  padding: 0;
  margin: 12px 0 24px;
}
.breakdown li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.breakdown .bar-label {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.breakdown .bar {
  height: 4px;
  background: var(--tint);
  margin-top: 8px;
  border-radius: 4px;
}
.breakdown .bar i {
  display: block;
  width: var(--w);
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
}
.stats {
  padding: 64px 0;
}
.stats h2 {
  font-size: 32px;
}
.stats-intro {
  max-width: 760px;
  color: var(--muted);
  margin-bottom: 32px;
}
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.stats details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 24px 16px;
  align-self: start;
}
.stats summary {
  cursor: pointer;
  font-weight: 600;
  padding: 16px 0;
  min-height: 44px;
}
.stats table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.stats th,
.stats td {
  padding: 12px 6px;
  border-bottom: 1px solid var(--line);
  text-align: start;
  overflow-wrap: anywhere;
}
.stats th {
  font-size: 12px;
  color: var(--muted);
}
.stats .num {
  text-align: end;
}
.stats caption {
  text-align: start;
  padding: 8px 0;
  color: var(--muted);
  font-size: 12px;
}
.stats .methodology {
  max-width: 800px;
  margin-top: 40px;
}
.stats p {
  color: var(--muted);
}
.stats .data-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  font-size: 13px;
  color: var(--accent);
}
.data-links a {
  min-height: 44px;
  display: flex;
  align-items: center;
}
.tt {
  position: fixed;
  pointer-events: none;
  z-index: 60;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 12px 16px;
  border-radius: 10px;
  box-shadow: 0 12px 40px #0003;
  max-width: 270px;
  font-size: 13px;
}
.tt strong {
  display: block;
  font-size: 16px;
}
.skip-link {
  position: fixed;
  top: -200px;
  inset-inline-start: 24px;
  z-index: 100;
  background: var(--surface);
  padding: 16px;
}
.skip-link:focus {
  top: 8px;
}
.preview-note,
.no-script {
  padding: 12px;
  background: #302713;
  border: 1px solid #b8944b;
  color: #f4d89b;
  font-size: 14px;
}
[dir="rtl"] .eyebrow,
[dir="rtl"] .brand small {
  letter-spacing: 0;
}
[dir="rtl"] .city-row .arrow {
  transform: scaleX(-1);
}
[dir="rtl"] h1 {
  letter-spacing: 0;
}
@media (min-width: 1500px) {
  #app {
    height: 550px;
  }
  .city-list {
    max-height: 428px;
  }
}
@media (max-width: 1440px) {
  .overview,
  .workspace,
  .stats,
  .no-script {
    margin-inline: 32px;
  }
  .site-header {
    padding-inline: 32px;
  }
}
@media (max-width: 1000px) {
  .workspace {
    grid-template-columns: 300px minmax(0, 1fr);
  }
  .map-key {
    gap: 12px;
    flex-wrap: wrap;
  }
  .home-link {
    display: none;
  }
  .intro .text-link {
    align-self: end;
  }
  .metric {
    padding: 20px;
  }
  .overview,
  .workspace,
  .stats {
    margin-inline: 24px;
  }
  .maphint {
    font-size: 10px;
  }
  .map-heading {
    padding-inline: 16px;
  }
}
@media (max-width: 760px) {
  .site-header {
    padding: 16px;
    gap: 12px;
  }
  .brand {
    font-size: 16px;
    gap: 8px;
  }
  .brand small {
    display: none;
  }
  .brand-logo {
    width: 72px;
    height: 48px;
  }
  .languages a {
    padding: 8px;
    min-width: 56px;
  }
  .overview,
  .workspace,
  .stats,
  .no-script {
    margin-inline: 16px;
  }
  .overview {
    padding-top: 28px;
  }
  .intro {
    display: block;
  }
  .intro-copy {
    font-size: 14px;
    margin-bottom: 12px;
  }
  .intro .text-link {
    margin-bottom: 16px;
    white-space: normal;
  }
  .metrics {
    grid-template-columns: 1fr 1fr;
  }
  .metric {
    padding: 16px 20px;
  }
  .metric:nth-child(3) {
    border-inline-start: 0;
    border-top: 1px solid var(--line);
  }
  .metric:nth-child(4) {
    border-top: 1px solid var(--line);
  }
  .metric dd {
    font-size: 32px;
  }
  .metric dt {
    font-size: 12px;
  }
  .snapshot {
    font-size: 11px;
    gap: 0;
  }
  .workspace {
    display: flex;
    flex-direction: column;
  }
  .map-card {
    order: -1;
  }
  .map-heading h2 {
    font-size: 14px;
  }
  #app {
    height: 430px;
    flex: none;
  }
  .explorer {
    --explorer-gutter: 20px;
    border-inline-end: 0;
  }
  .filters {
    padding-block-end: 8px;
  }
  .city-list {
    max-height: 330px;
  }
  .map-key {
    margin-inline: 16px;
    gap: 12px;
  }
  .bubble-key {
    max-width: 165px;
  }
  .coverage,
  .credit {
    margin-inline: 16px;
  }
  .maphint {
    padding-inline: 12px;
  }
  .detail {
    max-height: none;
  }
  .stats {
    padding: 40px 0;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .stats h2 {
    font-size: 28px;
  }
  .stats details {
    padding-inline: 16px;
  }
  .stats th,
  .stats td {
    font-size: 12px;
    padding: 10px 4px;
  }
  .intro h1 {
    font-size: 34px;
  }
  .map-status {
    padding: 48px 24px;
  }
}
@media (max-width: 380px) {
  .site-header {
    flex-wrap: wrap;
  }
  .map-key {
    align-items: start;
    flex-direction: column;
  }
  .metrics .metric {
    padding: 14px;
  }
  .zoomctl {
    inset-inline-end: 8px;
  }
  .overview,
  .workspace,
  .stats {
    margin-inline: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
