/* the map tab (js/where.js): city bubbles colored by how much each city grew or shrank since the first year (the site's --pos and --neg), faint state lines, a year slider. Tokens from ../style.css. */
:root { --w-none: #f3f2ef; }
:root[data-theme="dark"] { --w-none: #1b1b1d; }

/* the cover, as on the home page: a centered title and lede, the firm search, then the map with Play and the year slider under it */
#where .w-cover { padding-inline: var(--gut) max(16px, env(safe-area-inset-right, 0px)); padding-block: 0 28px; margin-inline: calc(-1 * var(--gut)) calc(-1 * max(16px, env(safe-area-inset-right, 0px))); }
#where .w-cover > .wrap { max-width: 1440px; padding-inline: clamp(0px, 2.2vw, 32px); }
#where .w-hero { display: grid; justify-items: center; text-align: center; padding-block: 48px 4px; }
#where .w-hero h2 { font-size: var(--t-display); line-height: 1.04; letter-spacing: -0.03em; font-weight: 700; color: var(--ink); margin: 0; max-width: 18em; }
#where .w-lede { margin-top: 14px; font-size: var(--t-lede); line-height: 1.4; color: var(--ink2); max-width: 42em; min-height: 2.8em; }
#where .w-lede b { color: var(--ink); font-weight: 600; }
#where .w-find { position: relative; display: flex; gap: 10px; align-items: center; justify-content: center; width: min(100%, 560px); margin: 24px 0 18px; }
#where .w-find input.search { flex: 1 1 auto; min-width: 0; font: inherit; font-size: 17px; padding: 13px 20px; border-radius: 980px; border: 1px solid var(--rule); background: color-mix(in srgb, var(--ink) 4%, var(--bg)); color: var(--ink); }
#where .w-find input.search::placeholder { color: var(--ink2); }
#where .w-find input.search:focus { border-color: var(--ink); background: var(--bg); outline: none; }
#where .w-find input.search:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }   /* the same ring as every other control */
#where .w-find .btn { flex: none; padding-block: 13px; }
#where .w-sug { position: absolute; z-index: 5; top: calc(100% + 6px); left: 0; right: 0; background: var(--bg); border: 1px solid var(--rule); border-radius: 14px; padding: 6px; box-shadow: 0 8px 28px rgba(0, 0, 0, .14); text-align: left; }
#where .w-sug button { display: flex; justify-content: space-between; gap: 12px; width: 100%; font: inherit; font-size: 15px; text-align: left; border: 0; background: none; color: var(--ink); padding: 9px 12px; border-radius: 8px; cursor: pointer; }
#where .w-sug button:hover, #where .w-sug button:focus-visible { background: var(--chip); }
#where .w-sug button span { color: var(--ink3); font-size: 13px; white-space: nowrap; }
#where .w-sug p { margin: 6px 10px; }
#where .w-mapwrap { display: grid; gap: 10px; }
#where .w-mapwrap > * { min-width: 0; }

/* Play, the year slider (ticks hang under its track), as on the home cover */
#where .w-play { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; padding: 4px 0 18px; max-width: 980px; width: 100%; margin-inline: auto; }
#where .w-pbtn { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 184px; white-space: nowrap; font-size: 13px; padding: 7px 14px; }
#where .w-pbtn svg { width: 13px; height: 13px; fill: currentColor; }
#where .w-scrub { flex: 1 1 320px; min-width: 0; position: relative; }
#where .w-scrub input[type=range] { width: 100%; margin: 0; height: 26px; cursor: pointer; display: block; background: transparent; -webkit-appearance: none; appearance: none; }
#where .w-scrub input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--ink2) var(--p, 100%), var(--rule) var(--p, 100%)); }
#where .w-scrub input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--ink2) var(--p, 100%), var(--rule) var(--p, 100%)); }
#where .w-scrub input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%; background: var(--ink); border: 0; }
#where .w-scrub input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--ink); border: 0; }
#where .w-ticks { position: absolute; left: 0; right: 0; top: 100%; height: 16px; margin-top: -2px; font-size: 12px; color: var(--ink3); font-variant-numeric: tabular-nums; }
#where .w-ticks span { position: absolute; left: calc(9px + (100% - 18px) * var(--x)); transform: translateX(-50%); white-space: nowrap; transition: color .3s; }
#where .w-ticks span:first-child { left: 0; transform: none; }
#where .w-ticks span:last-child { left: auto; right: 0; transform: none; }
#where .w-ticks span.on { color: var(--ink); font-weight: 600; }
#where .w-legend { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 10px 28px; }
#where .w-key { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; font-size: 13px; color: var(--ink2); }
#where .w-key span { display: inline-flex; align-items: center; gap: 7px; }
#where .w-key .k { --c: color-mix(in srgb, var(--pos) calc(max(0, var(--g)) * 100%), color-mix(in srgb, var(--neg) calc(max(0, -1 * var(--g)) * 100%), var(--ink3)));
  width: 12px; height: 12px; border-radius: 50%; flex: none; background: color-mix(in srgb, var(--c) calc(14% + 50% * max(var(--g), -1 * var(--g))), var(--bg)); border: 1.5px solid var(--c); }
#where .w-key .w-kh { color: var(--ink); font-weight: 600; }
#where .w-key .w-kall { color: var(--ink3); }
#where .seg { display: inline-flex; padding: 3px; border-radius: 980px; background: var(--chip); }
#where .seg button { font: inherit; font-size: 13px; border: 0; background: none; color: var(--ink2); padding: 0 14px; min-height: 32px; border-radius: 980px; cursor: pointer; transition: background .25s, color .25s; }
#where .seg button[aria-pressed="true"] { background: var(--bg); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--rule); }

/* the big faint year behind the bubbles: shows while the years play or the slider moves, fades away at rest */
#where text.w-yr { font-weight: 700; letter-spacing: -0.04em; fill: var(--ink); fill-opacity: 0; font-variant-numeric: tabular-nums; transition: fill-opacity .6s cubic-bezier(.2, .8, .2, 1); }
#where .timing text.w-yr { fill-opacity: .055; }
/* the first time the tab opens, bubbles sweep in left to right, then the city names */
html.motion #where .w-bub { transform-box: fill-box; transform-origin: 50% 50%; }
html.motion #where .w-map.ent .w-bub.big { animation: cm-pop .45s cubic-bezier(.34, 1.4, .64, 1) var(--dl, 0ms) backwards; }
html.motion #where .w-map.ent .w-lbl { animation: cm-fade .5s cubic-bezier(.2, .8, .2, 1) 900ms backwards; }
#where .w-map.ent { pointer-events: none; }

/* the map and the ranked list beside it */
#where .w-below { padding-top: 40px; }
#where .w-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 48px; align-items: start; }
#where .w-grid > * { min-width: 0; }
#where .w-map { position: relative; min-width: 0; }
#where .w-map svg { display: block; width: 100%; height: auto; overflow: hidden; max-height: max(340px, calc(100vh - 440px)); }   /* like the home map: title, map and Play fit one screen */
#where .w-wait { padding: 120px 0; text-align: center; }
#where .w-states { fill: none; stroke: var(--hair); stroke-width: 1; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
/* --g runs from -1 (half its first-year size or less) through 0 (flat, gray) to 1 (four times it or more), set by js each frame */
#where .w-bub { --g: 0; --c: color-mix(in srgb, var(--pos) calc(max(0, var(--g)) * 100%), color-mix(in srgb, var(--neg) calc(max(0, -1 * var(--g)) * 100%), var(--ink3)));
  --f: calc(14% + 50% * max(var(--g), -1 * var(--g)));   /* the bigger the change, the deeper the fill */
  fill: color-mix(in srgb, var(--c) var(--f), var(--bg)); stroke: var(--c); stroke-opacity: 1; stroke-width: 1; vector-effect: non-scaling-stroke; cursor: pointer; }
#where .w-bub.hov { fill: color-mix(in srgb, var(--c) calc(var(--f) + 18%), var(--bg)); stroke: var(--ink); stroke-width: 2; vector-effect: non-scaling-stroke; }
#where .w-bub.sel { fill: color-mix(in srgb, var(--c) calc(var(--f) + 10%), var(--bg)); stroke: var(--ink); stroke-opacity: 1; stroke-width: 2px; }
#where .hot #w-bubs .w-bub { fill: color-mix(in srgb, var(--c) 6%, var(--bg)); stroke: color-mix(in srgb, var(--c) 35%, var(--bg)); }   /* recolor, not opacity: a faded layer stalls some browsers */
#where .w-lbl { font-weight: 600; fill: var(--ink); paint-order: stroke; stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round; pointer-events: none; letter-spacing: -0.01em; }
#where .w-note { font-size: 13px; color: var(--ink3); max-width: 52em; line-height: 1.5; text-align: center; margin: 0 auto; }
#where .w-fid { font-size: 14px; color: var(--ink2); max-width: 52em; line-height: 1.45; text-align: center; margin: 0 auto; }
#where .w-mapwrap .ex-src { max-width: 52em; width: 100%; margin: 0 auto; text-align: center; }
#where .w-fid:empty { display: none; }
#where .w-note a, #where .w-limits a { color: var(--accent-ink); }
#where .w-rank h3 { font-size: 15px; font-weight: 600; letter-spacing: 0; color: var(--ink2); margin: 0 0 10px; }
#where .w-rank ol { list-style: none; margin: 0; padding: 0; }
#where .w-rank li button { display: grid; grid-template-columns: 22px minmax(0, 1fr) 70px; align-items: center; gap: 0 8px; width: 100%; font: inherit; font-size: 14px; color: var(--ink); background: none; border: 0; border-radius: 8px; padding: 6px 8px; min-height: 44px; cursor: pointer; text-align: left; }
#where .w-rank li button:hover, #where .w-rank li button.hov { background: var(--surface); }
#where .w-rank li button.sel { background: var(--chip); }
#where .w-rank .n { color: var(--ink3); font-size: 12px; font-variant-numeric: tabular-nums; }
#where .w-rank .nm { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
#where .w-rank .tr { display: block; height: 6px; border-radius: 3px; background: var(--hair); overflow: hidden; }
#where .w-rank .tr i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .6s cubic-bezier(.22, .8, .24, 1); }
#where .w-rank .v { text-align: right; font-variant-numeric: tabular-nums; font-size: 14px; line-height: 1.2; }
#where .w-rank .v small { display: block; font-size: 12px; color: var(--ink3); }

/* a picked city */
#where .w-panel { scroll-margin-top: 76px; }
#where .w-ph { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px 32px; flex-wrap: wrap; }
#where .w-ph h3 { font-size: var(--t-h3); margin: 0; letter-spacing: -0.02em; }
#where .w-ps { color: var(--ink2); margin-top: 6px; font-size: 15px; max-width: 40em; }
#where .w-spark svg { display: block; overflow: visible; }
#where .w-sl { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
#where .w-sl.gap { stroke-dasharray: 3 4; }
#where .w-sd { fill: var(--bg); stroke: var(--accent); stroke-width: 1.5; }
#where .w-sd.on { fill: var(--accent); }
#where .w-st { font-size: 12px; fill: var(--ink3); }
#where .w-sv { font-size: 12px; font-weight: 600; fill: var(--ink); font-variant-numeric: tabular-nums; }
#where table.w-firms { width: 100%; border-collapse: collapse; margin-top: 18px; font-size: 15px; }
#where table.w-firms th { text-align: left; font-weight: 500; font-size: 12px; color: var(--ink3); padding: 0 8px 8px 0; border-bottom: 1px solid var(--hair); }
#where table.w-firms td { padding: 11px 8px 11px 0; border-bottom: 1px solid var(--hair); vertical-align: middle; }
#where table.w-firms td a { color: var(--ink); text-decoration: none; }
#where table.w-firms td a:hover { text-decoration: underline; }
#where table.w-firms .r { text-align: right; font-variant-numeric: tabular-nums; padding-right: 0; padding-left: 8px; }
#where table.w-firms .ty { color: var(--ink3); font-size: 13px; }
#where .w-more { margin-top: 14px; font-size: 14px; }
#where .w-pn { margin-top: 12px; max-width: 46em; }
#where .w-jump { margin-top: 14px; padding: 12px 0 0; border-radius: 0; background: none; border-top: 1px solid var(--hair); color: var(--ink2); font-size: 14px; max-width: 46em; }

#where .w-limits { margin-top: 56px; display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
#where .w-limits h3 { font-size: 15px; font-weight: 600; margin: 0 0 8px; }
#where .w-limits ul { margin: 0; padding-left: 18px; color: var(--ink2); font-size: 14px; line-height: 1.5; }
#where .w-limits li { margin-bottom: 6px; }

@media (max-width: 900px) {
  #where .w-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  #where .w-limits { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 640px) {
  #where .w-hero { padding-top: 36px; }
  #where .w-find { flex-direction: column; align-items: stretch; }
  #where .w-find .btn { padding: 14px 22px; }
}
@media (max-width: 600px) {
  #where .w-play { padding-bottom: 0; }
  #where .pl-yrs { display: none; }
  #where .w-pbtn { width: 104px; min-height: 44px; padding-inline: 14px; }
  #where .w-scrub { flex: 1 1 100%; order: 3; margin-bottom: 20px; }
  #where .w-scrub input[type=range] { height: 44px; }
  #where .w-ticks { top: calc(100% - 12px); }
  #where .w-ticks span:nth-child(even) { visibility: hidden; }
  #where table.w-firms .ty, #where table.w-firms th.ty, #where table.w-firms .nm { display: none; }
}

/* the firm page's office map */
.w-fmap .w-mini { display: block; width: 100%; max-width: 760px; height: auto; margin: 8px auto 0; }
.w-fmap .ex-note a { color: var(--accent-ink); }
.w-mini .w-mstates { fill: var(--w-none); stroke: var(--bg); stroke-width: .8; vector-effect: non-scaling-stroke; }
.w-mini .w-nation { fill: none; stroke: var(--rule); stroke-width: .8; vector-effect: non-scaling-stroke; }
.w-mini .w-cn { fill: var(--w-none); stroke: var(--bg); stroke-width: .6; vector-effect: non-scaling-stroke; }
.w-mini circle { fill-opacity: .78; stroke: var(--bg); stroke-width: 1; vector-effect: non-scaling-stroke; cursor: pointer; }
.w-mini circle.z { fill-opacity: 0; stroke: var(--ink3); stroke-width: 1; }
.w-mini circle:hover { stroke: var(--ink); stroke-width: 2.25; fill-opacity: .95; }   /* the office under the pointer gets a ring (Connor 11/01) */
