:root {
  --paper: #ECEEEF;
  --white: #ffffff;
  --ink: #101418;
  --ink-2: #444e56;
  --line: #cbd1d5;
  --yellow: #ffd400;
  --steel: #b7c3cc;
  --pad: clamp(16px, 4vw, 48px);
  --max: 1320px;
  --focus: 0 0 0 3px var(--paper), 0 0 0 6px var(--ink);
  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-size: 17px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: none; box-shadow: var(--focus); }
h1, h2, h3, h4, p { margin: 0; }


/* ---------- intro + map ---------- */
.intro { max-width: var(--max); margin: 0 auto; padding: clamp(24px, 5vw, 56px) var(--pad) 28px; }
h1 {
  font-size: clamp(34px, 5.5vw, 68px); line-height: .98; letter-spacing: -.02em;
  font-weight: 850; font-stretch: 125%;
}
.intro-text { max-width: 34em; margin-top: 22px; font-size: clamp(18px, 2.2vw, 22px); line-height: 1.4; }
.intro-text span { font-weight: 800; }

.map { display: flex; gap: 14px; margin-top: 36px; }
.col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.col-head { display: flex; flex-direction: column; padding-bottom: 2px; }
.col-head b { font-size: 24px; line-height: 1.1; font-weight: 800; font-stretch: 112%; letter-spacing: -.01em; }
.col-head span { font-size: 15px; color: var(--ink-2); }
.blocks { flex: 1; display: flex; flex-direction: column; gap: 6px; min-height: 440px; }

.block {
  --fill: var(--ink); --text: #fff; --sel: var(--yellow);
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  min-height: 84px; padding: 16px 18px 14px; border: 0; border-radius: 0; text-align: left;
  background: var(--fill); color: var(--text); overflow: hidden;
  transition: transform .15s ease, opacity .2s ease;
}
.block.work { --fill: var(--ink); --text: #fff; --sel: var(--yellow); }
.block.machines { --fill: var(--steel); --text: var(--ink); --sel: var(--ink); }
.block.intelligence { --fill: var(--yellow); --text: var(--ink); --sel: var(--ink); }
.block:hover { transform: translateY(-3px); }
.block[aria-pressed="true"] { box-shadow: inset 0 0 0 5px var(--sel); }
.map.has-sel .block[aria-pressed="false"] { opacity: .45; }
.b-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; width: 100%; }
.b-name { font-size: 20px; line-height: 1.15; font-weight: 800; font-stretch: 105%; letter-spacing: -.005em; }
.b-count { font-size: 20px; font-weight: 800; font-stretch: 105%; font-variant-numeric: tabular-nums; }
.b-desc { max-width: 30em; font-size: 15px; line-height: 1.4; opacity: .88; }
.b-logos { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; padding-top: 6px; }
.map-foot { margin-top: 14px; font-size: 15px; color: var(--ink-2); }
.linkish { padding: 0; border: 0; background: none; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.linkish:hover { background: var(--yellow); color: var(--ink); }

/* ---------- logo tile ---------- */
.logo {
  position: relative; flex: none; display: grid; place-items: center; width: 40px; height: 40px;
  background: var(--white); border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
}
.logo .mono { font-weight: 800; font-size: 17px; color: var(--ink); }
.logo img { position: absolute; inset: 5px; width: calc(100% - 10px); height: calc(100% - 10px); object-fit: contain; background: var(--white); }
.logo.sm { width: 28px; height: 28px; border-radius: 5px; border-color: transparent; }
.logo.sm img { inset: 3px; width: calc(100% - 6px); height: calc(100% - 6px); }
.logo.sm .mono { font-size: 13px; }

/* ---------- layout: sidebar + results ---------- */
.layout { max-width: var(--max); margin: 0 auto; padding: 24px var(--pad) 64px; display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: start; border-top: 3px solid var(--ink); }
.side { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 22px; max-height: calc(100vh - 32px); overflow-y: auto; padding: 4px 4px 4px 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 15px; font-weight: 700; }
.field input, .field select {
  width: 100%; height: 48px; padding: 0 14px; background: var(--white); border: 2px solid var(--ink); border-radius: 0; font-size: 16px;
}
.field select { appearance: none; -webkit-appearance: none; padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' fill='none' stroke='%23101418' stroke-width='2.2'%3E%3Cpath d='m1 1.5 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; }
.field input::placeholder { color: #6b747b; }

.cats { display: flex; flex-direction: column; }
.cat-group { margin-top: 12px; font-size: 15px; font-weight: 800; font-stretch: 108%; }
.cat-group:first-child { margin-top: 0; }
.cat {
  display: flex; justify-content: space-between; gap: 10px; width: 100%; padding: 8px 10px; background: none; border: 0; border-left: 4px solid transparent;
  text-align: left; font-size: 16px; line-height: 1.3;
}
.cat b { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.cat:hover { background: var(--white); }
.cat[aria-pressed="true"] { background: var(--yellow); border-left-color: var(--ink); font-weight: 700; }
.cat[aria-pressed="true"] b { color: var(--ink); }

/* ---------- results ---------- */
.status { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; padding-bottom: 18px; font-size: 16px; color: var(--ink-2); }
.status strong { color: var(--ink); font-weight: 700; }

.territory + .territory { margin-top: 56px; }
.territory > header h2 { font-size: clamp(32px, 4.5vw, 52px); line-height: 1; font-weight: 850; font-stretch: 120%; letter-spacing: -.02em; }
.territory > header p { margin-top: 6px; font-size: 18px; color: var(--ink-2); }
.cat-section { margin-top: 36px; }
.cat-section > header { padding: 14px 0 12px; border-top: 3px solid var(--ink); }
.cat-section h3 { display: flex; align-items: baseline; gap: 12px; font-size: 26px; line-height: 1.15; font-weight: 800; font-stretch: 108%; letter-spacing: -.01em; }
.cat-section h3 small { font-size: 17px; font-weight: 600; color: var(--ink-2); }
.cat-section > header p { max-width: 42em; margin-top: 4px; color: var(--ink-2); }
.industry { margin-top: 22px; }
.industry h4 { display: inline-block; margin-bottom: 4px; padding: 3px 10px; background: var(--yellow); font-size: 15px; font-weight: 800; }
.industry h4 small { font-weight: 600; margin-left: 4px; }

.co {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) 230px; gap: 8px 18px; padding: 16px 0; border-bottom: 1px solid var(--line);
}
.co-main { min-width: 0; }
.co-name { font-size: 19px; font-weight: 700; line-height: 1.25; }
.co-name a { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; text-decoration-color: var(--line); }
.co-name a:hover { text-decoration-color: var(--ink); background: var(--yellow); }
.co-host { margin-left: 8px; font-size: 14px; font-weight: 400; color: var(--ink-2); }
.co-desc { max-width: 40em; margin-top: 3px; color: var(--ink); }
.co-meta { font-size: 15px; line-height: 1.4; color: var(--ink-2); }
.co-meta div + div { margin-top: 4px; }
.co-meta em { font-style: normal; font-weight: 600; color: var(--ink); background: #ffe97a; padding: 0 4px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.empty { padding: 56px 0; }
.empty p { font-size: 22px; font-weight: 700; }
.empty .linkish { margin-top: 10px; font-size: 17px; }
.foot { max-width: var(--max); margin: 0 auto; padding: 24px var(--pad) 56px; border-top: 3px solid var(--ink); }
.foot .made { font-size: 16px; font-weight: 600; color: var(--ink); }
.foot .made a { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.foot .made a:hover { background: var(--yellow); }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; max-height: none; overflow: visible; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  /* The map blocks above do the category job on small screens, so the long list is dropped. */
  .side .field:last-child { display: none; }
}
@media (max-width: 900px) {
  .map { flex-direction: column; }
  .col { width: 100%; flex: none !important; }
  .blocks { min-height: 0; }
  .block { flex-grow: 0 !important; }
  .b-logos { display: none; }
}
@media (max-width: 760px) {
  .co { grid-template-columns: 40px minmax(0, 1fr); }
  .co-meta { grid-column: 2; }
  .side { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
