/* AZ/ATLAS — dark cartographer sheet */
:root {
  --bg: #0E1311;
  --surface: #151C19;
  --line: #26302C;
  --line-2: #3A4642;
  --fg: #EDEEE8;
  --fg-2: #B9C2BD;
  --fg-3: #9AA59F;
  --accent: #FF7A5C;
  --sea: #6FA7C4;

  --f-head: "Unbounded", "Arial Black", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --f-text: "Inter Tight", "Segoe UI", Arial, sans-serif;

  --gut: 32px;
  --header-h: 56px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.5 var(--f-text);
  overflow-x: hidden;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border-radius: 0; }
a { color: inherit; }
.mono { font-family: var(--f-mono); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--bg); padding: 10px 14px; font-family: var(--f-mono);
}
.skip:focus { top: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- 1. Header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px;
  height: var(--header-h); padding: 0 var(--gut);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.topbar__left { display: flex; align-items: center; gap: 20px; min-width: 0; }
.logo {
  font: 800 18px/1 var(--f-head); letter-spacing: .02em; text-decoration: none; text-transform: uppercase;
}
.logo span { color: var(--accent); }
.topbar__coord { font-size: 12px; color: var(--fg-3); white-space: nowrap; }
.cursor {
  display: inline-block; width: 7px; height: 13px; margin-left: 6px; vertical-align: -2px;
  background: var(--accent); animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.nav { display: flex; justify-content: center; gap: 28px; }
.nav a {
  position: relative; padding: 6px 0; text-decoration: none; font-size: 14px; color: var(--fg-2);
  white-space: nowrap; transition: color .2s;
}
.nav a .mono { font-size: 11px; color: var(--fg-3); }
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease);
}
.nav a:hover, .nav a:focus-visible { color: var(--fg); }
.nav a:hover::after, .nav a:focus-visible::after { transform: scaleX(1); }

.langs { display: flex; border: 1px solid var(--line-2); }
.lang {
  min-width: 40px; height: 32px; padding: 0 8px; background: transparent; border: 0;
  font: 500 12px/1 var(--f-mono); color: var(--fg-3); transition: background .2s, color .2s;
}
.lang + .lang { border-left: 1px solid var(--line-2); }
.lang:hover { color: var(--fg); }
.lang[aria-pressed="true"] { background: var(--fg); color: var(--bg); }

/* ---------- 2. Ticker ---------- */
.ticker { overflow: hidden; border-bottom: 1px solid var(--line); background: var(--surface); }
.ticker__track {
  display: flex; width: max-content;
  animation: ticker 140s linear infinite;
}
.ticker:hover .ticker__track, .ticker:focus-within .ticker__track { animation-play-state: paused; }
@keyframes ticker { to { transform: translateX(-50%); } }
.ticker__item {
  display: inline-flex; align-items: center; gap: 18px; padding: 0 18px 0 0; height: 38px;
  background: none; border: 0; white-space: nowrap;
  font: 500 12px/1 var(--f-mono); letter-spacing: .08em; color: var(--fg-2);
  transition: color .2s;
}
.ticker__item::after { content: "✦"; color: var(--line-2); font-size: 10px; }
.ticker__item:hover, .ticker__item:focus-visible { color: var(--accent); }
.ticker__item[aria-current="true"] { color: var(--fg); }

/* ---------- 3. Hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 40px; align-items: end;
  padding: 36px var(--gut) 32px; border-bottom: 1px solid var(--line);
}
.hero__title {
  margin: 0; font: 800 clamp(34px, 5.4vw, 80px)/0.98 var(--f-head); text-transform: uppercase; letter-spacing: -.01em;
}
.hero__title .line { display: block; overflow: hidden; padding-bottom: .04em; }
.hero__title .line > span {
  display: inline-block; transform: translateY(105%);
  animation: rise .9s var(--ease) forwards;
}
.hero__title .line:nth-child(2) > span { animation-delay: .14s; }
.hero__title .line:nth-child(3) > span { animation-delay: .28s; }
@keyframes rise { to { transform: none; } }
.line--accent { color: var(--accent); }
/* stroke painted under a bg-coloured fill hides the overlapping contours of the variable font */
.line--outline { color: var(--bg); -webkit-text-stroke: 3px var(--fg); paint-order: stroke fill; }
@supports not (-webkit-text-stroke: 1px black) { .line--outline { color: var(--fg); } }

.hero__lead { margin: 0 0 22px; max-width: 46ch; color: var(--fg-2); }

.search__label { display: block; margin-bottom: 8px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-3); }
.search__box { position: relative; }
.search input {
  width: 100%; height: 48px; padding: 0 14px 0 40px;
  background: var(--surface); border: 1px solid var(--line-2); outline: none;
  font-family: var(--f-mono); font-size: 15px;
  transition: border-color .2s;
}
.search__box::before {
  content: ""; position: absolute; left: 14px; top: 16px; width: 11px; height: 11px;
  border: 1.5px solid var(--fg-3); border-radius: 50%; pointer-events: none;
}
.search__box::after {
  content: ""; position: absolute; left: 25px; top: 28px; width: 6px; height: 1.5px;
  background: var(--fg-3); transform: rotate(45deg); transform-origin: left; pointer-events: none;
}
.search input:focus { border-color: var(--accent); }
.search input::placeholder { color: var(--fg-3); }
.search__list {
  position: absolute; z-index: 30; left: 0; right: 0; top: 100%; margin: 0; padding: 0; list-style: none;
  max-height: 320px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line-2); border-top: 0;
}
.search__opt {
  display: flex; justify-content: space-between; gap: 12px; align-items: baseline;
  min-height: 44px; padding: 11px 14px; cursor: pointer; border-top: 1px solid var(--line);
}
.search__opt small { font-family: var(--f-mono); font-size: 11px; color: var(--fg-3); white-space: nowrap; }
.search__opt[aria-selected="true"], .search__opt:hover { background: var(--line); }
.search__opt[aria-selected="true"] { box-shadow: inset 2px 0 0 var(--accent); }
.search__none { padding: 12px 14px; color: var(--fg-3); font-family: var(--f-mono); font-size: 13px; border-top: 1px solid var(--line); }

/* ---------- 4. Atlas ---------- */
.atlas {
  display: grid; grid-template-columns: minmax(0, 1fr) 380px;
  border-bottom: 1px solid var(--line);
}
.atlas__map { min-width: 0; border-right: 1px solid var(--line); display: flex; flex-direction: column; }

.modes {
  display: flex; align-items: stretch; flex-wrap: wrap; border-bottom: 1px solid var(--line);
}
.modes__label {
  display: flex; align-items: center; padding: 0 16px 0 var(--gut);
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-3);
}
.mode {
  min-height: 42px; padding: 0 16px; background: transparent; border: 0; border-left: 1px solid var(--line);
  font-size: 13px; color: var(--fg-2); transition: background .2s, color .2s;
}
.mode:hover { color: var(--fg); background: var(--surface); }
.mode[aria-pressed="true"] { color: var(--bg); background: var(--fg); }

.map {
  position: relative; overflow: hidden; flex: 1;
  background-color: var(--bg);
  background-image:
    linear-gradient(90deg, rgba(111,167,196,0) 70%, rgba(111,167,196,.07)),
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 100% 100%, 40px 40px, 40px 40px;
  background-position: 0 0, -1px -1px, -1px -1px;
}
.map::before {
  /* fade grid so it stays subtle */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 45% 50%, rgba(14,19,17,.35), rgba(14,19,17,.8));
}
#map-svg {
  position: relative; display: block; width: 100%; height: auto; aspect-ratio: 1000 / 760;
  max-height: max(320px, calc(100svh - var(--header-h) - 44px));
  touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none;
}
#map-svg:active { cursor: grabbing; }

.district {
  stroke: var(--bg); stroke-width: calc(1.1px / var(--k, 1)); stroke-linejoin: round;
  fill-opacity: 1; cursor: pointer; outline: none;
  transition: fill .55s ease var(--d, 0ms), fill-opacity .35s ease;
}
.district.is-peer { fill-opacity: .8; }
.district.is-dim { fill-opacity: .35; }
.district:hover { fill-opacity: 1; }
.is-intro .district { fill-opacity: 0; stroke: var(--fg-2); }
.is-filling .district { transition: fill .55s ease var(--d, 0ms), fill-opacity .8s ease calc(var(--d, 0ms) * 2.5), stroke 1.2s ease; }
.outline { fill: none; pointer-events: none; stroke-linejoin: round; }
.outline--hover { stroke: var(--fg); stroke-width: calc(1.4px / var(--k, 1)); }
.outline--sel { stroke: var(--accent); stroke-width: calc(2.6px / var(--k, 1)); }
.district:focus-visible { stroke: var(--accent); stroke-width: calc(2px / var(--k, 1)); }

.map__overlay { position: absolute; inset: 0; pointer-events: none; }
.marker { position: absolute; left: 0; top: 0; width: 0; height: 0; }
.marker[hidden] { display: none; }
.marker__dot, .marker__ping, .marker__radar { position: absolute; left: 0; top: 0; border-radius: 50%; transform: translate(-50%, -50%); }
.marker__dot { width: 9px; height: 9px; background: var(--accent); box-shadow: 0 0 0 2px var(--bg); }
.marker__ping {
  width: 10px; height: 10px; border: 1.5px solid var(--accent);
  animation: ping 2.2s cubic-bezier(.1, .6, .3, 1) infinite;
}
.marker__ping--2 { animation-delay: 1.1s; }
@keyframes ping {
  0% { width: 10px; height: 10px; opacity: 1; }
  100% { width: 90px; height: 90px; opacity: 0; }
}
.marker__radar {
  width: 220px; height: 220px;
  background: conic-gradient(from 0deg, rgba(255,122,92,0) 0deg, rgba(255,122,92,0) 290deg, rgba(255,122,92,.12) 330deg, rgba(255,160,130,.45) 359deg, rgba(255,122,92,0) 360deg);
  -webkit-mask: radial-gradient(circle, #000 0 69%, transparent 70%);
          mask: radial-gradient(circle, #000 0 69%, transparent 70%);
  mix-blend-mode: screen;
  animation: radar 3.6s linear infinite;
}
@keyframes radar { from { transform: translate(-50%, -50%) rotate(0); } to { transform: translate(-50%, -50%) rotate(360deg); } }

.map__sea {
  position: absolute; right: 18px; top: 50%; transform: translateY(-50%) rotate(180deg);
  writing-mode: vertical-rl; font-size: 12px; letter-spacing: .5em; color: var(--sea);
  pointer-events: none; opacity: .85;
}
.map__coord {
  position: absolute; right: 16px; top: 14px; padding: 6px 9px;
  font-size: 12px; color: var(--fg-2); background: rgba(14,19,17,.85); border: 1px solid var(--line);
  pointer-events: none; font-variant-numeric: tabular-nums;
}
.map__ctrl { position: absolute; left: 16px; top: 14px; display: flex; flex-direction: column; gap: -1px; }
.ctrl {
  width: 40px; height: 40px; margin-top: -1px; background: var(--bg); border: 1px solid var(--line-2);
  font: 500 18px/1 var(--f-mono); color: var(--fg); transition: border-color .2s, color .2s;
}
.ctrl--wide { width: auto; padding: 0 12px; font-size: 12px; margin-top: 8px; }
.ctrl:hover { border-color: var(--accent); color: var(--accent); }
.compass {
  position: absolute; right: 52px; bottom: 16px; width: 64px; height: 64px; color: var(--fg-3);
  pointer-events: none; overflow: visible;
}
.compass text { font: 600 8px var(--f-mono); fill: var(--fg-2); }
.compass__rose { transform-origin: 40px 40px; animation: compass 60s linear infinite; }
@keyframes compass { to { transform: rotate(360deg); } }

.tooltip {
  position: absolute; z-index: 10; left: 0; top: 0; pointer-events: none;
  padding: 8px 10px; min-width: 120px; background: var(--bg); border: 1px solid var(--line-2);
  font-size: 12px; line-height: 1.4; white-space: nowrap;
}
.tooltip b { display: block; font: 600 11px/1.3 var(--f-head); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 3px; }
.tooltip span { color: var(--fg-3); }

.legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
  padding: 12px var(--gut); border-top: 1px solid var(--line); min-height: 52px;
  font: 400 11px/1.3 var(--f-mono); color: var(--fg-2);
}
.legend__title { width: 100%; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-3); }
.legend__item { display: inline-flex; align-items: center; gap: 6px; }
.legend__sw { width: 12px; height: 12px; flex: none; }
.legend--scale { gap: 0; }
.legend--scale .legend__title { margin-bottom: 6px; }
.legend__step { flex: 1 1 0; min-width: 0; }
.legend__step i { display: block; height: 10px; }
.legend__step span { display: block; padding-top: 5px; font-size: 10px; color: var(--fg-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Panel ---------- */
.panel { min-width: 0; background: var(--bg); }
.panel__inner { padding: 22px 24px 26px; position: sticky; top: var(--header-h); }
.panel.is-enter .panel__inner { animation: panelIn .5s var(--ease); }
@keyframes panelIn { from { opacity: 0; transform: translateY(26px); } }
.panel__kicker { margin: 0 0 10px; font-size: 11px; letter-spacing: .14em; color: var(--accent); }
.panel__name {
  margin: 0 0 14px; font: 800 clamp(30px, 3vw, 42px)/1 var(--f-head); text-transform: uppercase; word-break: break-word;
}
.panel__meta { margin: 0 0 18px; font-size: 12px; border-top: 1px solid var(--line); }
.panel__meta div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.panel__meta dt { color: var(--fg-3); }
.panel__meta dd { margin: 0; text-align: right; color: var(--fg); }
.panel__meta .sw { display: inline-block; width: 9px; height: 9px; margin-right: 7px; vertical-align: 0; }

.cells { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cell {
  display: flex; flex-direction: column; justify-content: space-between; gap: 10px; min-height: 86px; padding: 11px 12px;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  transition: box-shadow .25s;
}
.cell:hover { box-shadow: inset 0 0 0 1px var(--accent); }
.cell__label { font-size: 10.5px; line-height: 1.3; color: var(--fg-3); letter-spacing: .02em; }
.cell__val { font: 600 clamp(19px, 1.9vw, 25px)/1 var(--f-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cell__val .approx { color: var(--accent); margin-right: 2px; }
.panel__approx { margin: 8px 0 0; font-size: 11px; color: var(--fg-3); }
.panel__approx::before { content: "≈ "; color: var(--accent); }

.dens { margin: 18px 0 0; }
.dens__head { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; color: var(--fg-3); margin-bottom: 8px; }
.dens__head span:last-child { color: var(--fg-2); text-align: right; }
.dens__track { position: relative; height: 8px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 22px; }
.dens__fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--accent); transition: width .8s var(--ease); }
.dens__avg { position: absolute; top: -5px; bottom: -5px; left: 33.333%; width: 1px; background: var(--fg); }
.dens__avg span { position: absolute; top: 100%; left: 0; transform: translateX(-50%); padding-top: 3px; font-size: 10px; color: var(--fg-3); white-space: nowrap; }

.ranks { list-style: none; margin: 4px 0 0; padding: 0; font-size: 12px; border-top: 1px solid var(--line); }
.ranks li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--fg-3); }
.ranks b { color: var(--fg); font-weight: 500; }

.panel__h { margin: 18px 0 8px; font-size: 10.5px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-3); }
.panel__extra p { margin: 0; color: var(--fg-2); font-size: 14px; }
.sights { margin: 0; padding: 0; list-style: none; font-size: 14px; color: var(--fg-2); }
.sights li { padding: 5px 0; border-bottom: 1px solid var(--line); }
.sights li::before { content: "→ "; color: var(--accent); font-family: var(--f-mono); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  min-height: 32px; padding: 4px 10px; background: transparent; border: 1px solid var(--line-2);
  font-size: 13px; color: var(--fg-2); transition: border-color .2s, color .2s;
}
.chip:hover, .chip:focus-visible { border-color: var(--accent); color: var(--fg); }

.panel__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.btn {
  min-height: 44px; padding: 0 18px; background: transparent; border: 1px solid var(--line-2);
  font: 500 13px/1 var(--f-mono); color: var(--fg); letter-spacing: .02em;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s, background .2s;
}
.btn:hover { border-color: var(--fg-2); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--bg); font-weight: 600; }
.btn--primary:hover:not(:disabled) { transform: translate(-4px, -4px); box-shadow: 4px 4px 0 0 var(--fg); border-color: var(--accent); }
.btn--primary:disabled { opacity: .55; cursor: default; }
.btn--primary.is-on { background: transparent; color: var(--accent); }

/* ---------- 5. Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); }
.stat { display: flex; flex-direction: column; gap: 8px; padding: 26px var(--gut); border-right: 1px solid var(--line); transition: box-shadow .25s; }
.stat:last-child { border-right: 0; }
.stat:hover { box-shadow: inset 0 0 0 1px var(--accent); }
.stat__val { font: 800 clamp(24px, 3vw, 40px)/1 var(--f-head); white-space: nowrap; }
.stat__val small { font-size: .5em; font-weight: 600; color: var(--fg-2); }
.stat__label { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-3); }

/* ---------- Sections ---------- */
.section { padding: 44px var(--gut) 52px; border-bottom: 1px solid var(--line); }
.section__head { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; align-items: baseline; margin-bottom: 26px; }
.section__num { font-size: 12px; color: var(--accent); }
.section__title { margin: 0; font: 800 clamp(26px, 3.4vw, 44px)/1 var(--f-head); text-transform: uppercase; }
.section__lead { grid-column: 2; margin: 6px 0 0; color: var(--fg-2); max-width: 60ch; }

/* Compare */
.compare { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); }
.compare__empty {
  display: flex; align-items: center; justify-content: center; min-height: 160px; padding: 24px; text-align: center;
  font-family: var(--f-mono); font-size: 14px; color: var(--fg-3);
  background-image: repeating-linear-gradient(135deg, transparent 0 10px, rgba(38,48,44,.45) 10px 11px);
}
.ctable { width: 100%; min-width: 560px; border-collapse: collapse; table-layout: fixed; }
.ctable th, .ctable td { padding: 14px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); }
.ctable tr > :first-child { border-left: 0; width: 150px; }
.ctable tr:last-child > * { border-bottom: 0; }
.ctable thead th { vertical-align: bottom; }
.ctable__metric { font: 500 11px/1.3 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); }
.ctable__name { display: block; font: 800 18px/1.1 var(--f-head); text-transform: uppercase; margin-bottom: 4px; word-break: break-word; }
.ctable__type { display: block; font: 400 11px var(--f-mono); color: var(--fg-3); margin-bottom: 10px; }
.ctable__head-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.linkbtn {
  min-height: 32px; padding: 0 10px; background: transparent; border: 1px solid var(--line-2);
  font: 400 11px var(--f-mono); color: var(--fg-3); transition: border-color .2s, color .2s;
}
.linkbtn:hover { border-color: var(--accent); color: var(--accent); }
.cval { font: 600 16px/1.2 var(--f-mono); font-variant-numeric: tabular-nums; }
.cbar { height: 3px; margin-top: 8px; background: var(--line); }
.cbar i { display: block; height: 100%; background: var(--fg-2); width: 0; transition: width .7s var(--ease); }
.cbar i.is-max { background: var(--accent); }
.cecon { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }

/* Ranking */
.rank-ctrl { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.seg { display: flex; border: 1px solid var(--line-2); }
.seg__btn {
  min-height: 40px; padding: 0 14px; background: transparent; border: 0; font-size: 13px; color: var(--fg-2);
  transition: background .2s, color .2s;
}
.seg__btn + .seg__btn { border-left: 1px solid var(--line-2); }
.seg__btn:hover { color: var(--fg); }
.seg__btn[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.rank { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rank li { border-bottom: 1px solid var(--line); }
.rank__row {
  display: grid; grid-template-columns: 44px minmax(120px, 220px) 1fr minmax(90px, auto) 28px; align-items: center; gap: 16px;
  width: 100%; min-height: 52px; padding: 8px 0; background: none; border: 0; text-align: left;
  transition: transform .3s var(--ease);
}
.rank__row:hover, .rank__row:focus-visible { transform: translateX(20px); }
.rank__pos { font: 500 12px var(--f-mono); color: var(--fg-3); }
.rank__name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank__name small { font: 400 11px var(--f-mono); color: var(--fg-3); margin-left: 6px; }
.rank__bar { height: 4px; background: var(--line); }
.rank__bar i { display: block; height: 100%; background: var(--fg-2); transform-origin: left; transition: width .6s var(--ease), background .2s; }
.rank__val { font: 500 14px var(--f-mono); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank__arrow { font-family: var(--f-mono); color: var(--fg-3); transition: transform .3s var(--ease), color .2s; }
.rank__row:hover .rank__arrow, .rank__row:focus-visible .rank__arrow { transform: translateX(6px); color: var(--accent); }
.rank__row:hover .rank__bar i { background: var(--accent); }
.rank__row:hover .rank__name { color: var(--accent); }

/* ---------- 8. Footer ---------- */
.footer { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; padding: 44px var(--gut) 0; }
.footer__about p { color: var(--fg-2); max-width: 52ch; }
.footer__about .section__title { margin: 8px 0 14px; font-size: clamp(22px, 2.6vw, 32px); }
.footer__notes { list-style: none; margin: 0; padding: 0; font-size: 12px; color: var(--fg-2); border-top: 1px solid var(--line); }
.footer__notes li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.footer__bar {
  grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 16px;
  padding: 16px 0 22px; border-top: 1px solid var(--line); font-size: 11px; color: var(--fg-3);
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .nav { gap: 18px; }
  .topbar__coord { display: none; }
  .atlas { grid-template-columns: minmax(0, 1fr) 340px; }
}
@media (max-width: 860px) {
  :root { --gut: 16px; }
  .topbar {
    grid-template-columns: 1fr auto; height: auto; row-gap: 0; padding-top: 6px;
  }
  .topbar__left { height: 44px; }
  .nav {
    grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; gap: 0;
    margin: 0 calc(var(--gut) * -1); padding: 0 var(--gut); border-top: 1px solid var(--line);
    overflow-x: auto; scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; padding: 0 14px 0 0; font-size: 13px; }
  .logo { display: inline-flex; align-items: center; min-height: 44px; }
  .nav a::after { right: 14px; bottom: 8px; }
  .lang { min-width: 44px; height: 44px; }
  :root { --header-h: 96px; }

  .hero { grid-template-columns: 1fr; gap: 22px; padding: 24px var(--gut); }
  .hero__lead { margin-bottom: 16px; }

  .atlas { grid-template-columns: 1fr; }
  .atlas__map { border-right: 0; border-bottom: 1px solid var(--line); }
  .modes__label { width: 100%; padding: 10px var(--gut) 4px; }
  .modes { border-bottom: 0; }
  .mode { flex: 1 1 auto; min-height: 44px; padding: 0 10px; border-top: 1px solid var(--line); font-size: 12.5px; }
  .mode:first-of-type { border-left: 0; }
  .map { border-top: 1px solid var(--line); }
  .ctrl { width: 44px; height: 44px; }
  .ctrl--wide { width: auto; }
  .map__ctrl { left: 10px; top: 10px; }
  .map__coord { right: 10px; top: 10px; font-size: 11px; }
  .map__sea { right: 6px; font-size: 10px; letter-spacing: .35em; }
  .compass { width: 44px; height: 44px; right: 30px; bottom: 10px; }
  .panel__inner { position: static; padding: 20px var(--gut) 26px; }
  .chip { min-height: 44px; }
  .linkbtn { min-height: 44px; }
  .seg__btn { min-height: 44px; }

  .stats { grid-template-columns: 1fr 1fr; }
  .stat { padding: 18px var(--gut); border-bottom: 1px solid var(--line); }
  .stat:nth-child(2n) { border-right: 0; }
  .stat:nth-child(n+3) { border-bottom: 0; }

  .section { padding: 32px var(--gut) 40px; }
  .section__head { grid-template-columns: 1fr; }
  .section__lead { grid-column: 1; }
  .rank__row { grid-template-columns: 30px minmax(0, 1fr) minmax(70px, auto) 18px; gap: 10px; }
  .rank__bar { grid-column: 2 / 4; grid-row: 2; }
  .rank__arrow { grid-row: 1; grid-column: 4; }
  .rank__row:hover, .rank__row:focus-visible { transform: translateX(12px); }

  .footer { grid-template-columns: 1fr; padding-top: 32px; }
}
@media (max-width: 420px) {
  .topbar__coord { display: none; }
  .logo { font-size: 16px; }
  .cell__val { font-size: 19px; }
  .cell { padding: 10px; min-height: 80px; }
}
@media (pointer: coarse) {
  .ticker__item { height: 44px; }
  .mode, .seg__btn, .lang, .btn, .chip, .linkbtn { min-height: 44px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important; transition-delay: 0ms !important;
  }
  .hero__title .line > span { transform: none; animation: none; }
  .ticker__track { animation: none; overflow-x: auto; }
  .ticker { overflow-x: auto; }
  .cursor { animation: none; }
  .marker__ping, .marker__radar { display: none; }
  .compass__rose { animation: none; }
}
