/* Swarm Research: a landing page for the swarm research community.
   Shared by every direction so they differ in structure, not decoration.
   Concept: logos carry the page; text stays to a name and one line. Left-aligned throughout.
   Color: cool paper, ink, and the tracker's orange only for the escapee (the mark and Swarm Incidents). */
:root {
  color-scheme: light;
  --paper: #F4F6F8; --surface: #FFFFFF; --ink: #12161D; --ink-2: #4A5361; --muted: #737C8A;
  --line: #E1E5EA; --line-2: #CBD1D9; --hover: #EBEEF2; --escape: #EB6834;
  --tile: #FFFFFF; --tile-line: #DFE3E8;
  --mark-tile: #12161D; --mark-ring: #7A8391; --mark-dot: #F4F6F8;
  /* Monograms, tinted by section, for entries without a logo. */
  --m-people: #DCE4F1; --m-people-ink: #34507E;
  --m-tools: #DCEAE3; --m-tools-ink: #2C6249;
  --m-data: #E6E1F2; --m-data-ink: #514283;
  --m-environments: #DDEDEF; --m-environments-ink: #2B636B;
  --m-trackers: #F4E2DA; --m-trackers-ink: #9A4526;
  --display: "Bricolage Grotesque", "Hanken Grotesk", system-ui, sans-serif;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --page: 1180px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #0C0F14; --surface: #141820; --ink: #E8EBEF; --ink-2: #B0B7C2; --muted: #848C98;
    --line: #232934; --line-2: #333B47; --hover: #1A1F28; --escape: #EE7444;
    --tile: #F7F8FA; --tile-line: #2C333E;
    --mark-tile: #E8EBEF; --mark-ring: #6B7280; --mark-dot: #0C0F14;
    --m-people: #1D2738; --m-people-ink: #A8BEE3;
    --m-tools: #18291F; --m-tools-ink: #9CCDB3;
    --m-data: #241F36; --m-data-ink: #C1B5EA;
    --m-environments: #172A2D; --m-environments-ink: #9CCFD5;
    --m-trackers: #33201A; --m-trackers-ink: #F0B39A;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0C0F14; --surface: #141820; --ink: #E8EBEF; --ink-2: #B0B7C2; --muted: #848C98;
  --line: #232934; --line-2: #333B47; --hover: #1A1F28; --escape: #EE7444;
  --tile: #F7F8FA; --tile-line: #2C333E;
  --mark-tile: #E8EBEF; --mark-ring: #6B7280; --mark-dot: #0C0F14;
  --m-people: #1D2738; --m-people-ink: #A8BEE3;
  --m-tools: #18291F; --m-tools-ink: #9CCDB3;
  --m-data: #241F36; --m-data-ink: #C1B5EA;
  --m-environments: #172A2D; --m-environments-ink: #9CCFD5;
  --m-trackers: #33201A; --m-trackers-ink: #F0B39A;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: var(--page); margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
h1, h2, h3 { font-family: var(--display); font-weight: 650; letter-spacing: -0.02em; text-wrap: balance; margin: 0; }

/* Header */
.site-head { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.site-head.scrolled { border-bottom-color: var(--line); }
.site-head .wrap { display: flex; align-items: center; gap: 12px 24px; min-height: 64px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 650; font-size: 19px; letter-spacing: -0.02em; white-space: nowrap; }
.brand svg { width: 28px; height: 28px; flex: none; }
/* The wordmark (option 04, October 21): swarms.wiki in heavy type, no symbol, one colour; the dot
   is a small square in the ink colour. */
.wordmark { font-family: "Inter", var(--sans); font-weight: 800; font-size: 1.14em; line-height: 1; letter-spacing: -0.05em; white-space: nowrap; }
.wordmark .dot { display: inline-block; width: .2em; height: .2em; margin: 0 .06em; border-radius: .04em; background: var(--ink); color: transparent; overflow: hidden; line-height: 0; vertical-align: baseline; }
.head-nav { display: flex; gap: 4px 18px; flex-wrap: wrap; font-size: 15px; color: var(--ink-2); }
.head-nav a { text-decoration: none; padding: 4px 0; }
.head-nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.head-end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: 600 14.5px/1 var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--ink-2); }
.btn.ink { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn.ink:hover { opacity: .88; }
.btn.icon { width: 38px; padding: 0; }
.btn.icon svg { width: 17px; height: 17px; }
@media (max-width: 760px) {
  .head-nav { display: none; }
  .brand { font-size: 17px; }
  .btn.suggest { height: 34px; padding: 0 12px; font-size: 13.5px; }
  .btn.icon { width: 34px; height: 34px; }
}
.btn.suggest, .btn.tracker { gap: .28em; }
.btn.tracker { background: var(--ink); border-color: var(--ink); color: var(--paper); padding-left: 10px; }
.btn.tracker img { width: 20px; height: 20px; border-radius: 5px; margin-right: 4px; }
.btn.tracker:hover { opacity: .9; }
.btn .short { display: none; }
/* Phones: wordmark, tracker button and theme toggle stay on one line. */
@media (max-width: 440px) {
  .site-head .wrap { gap: 10px 12px; flex-wrap: nowrap; }
  .brand { gap: 8px; font-size: 17px; }
  .brand svg { width: 24px; height: 24px; }
  .head-end { gap: 6px; }
  .btn.tracker { padding: 0 12px 0 8px; height: 34px; font-size: 13.5px; }
  .btn.tracker img { width: 18px; height: 18px; margin-right: 2px; }
}
@media (max-width: 440px) { .btn.tracker .long { display: none; } .btn.tracker .short { display: inline; } }

/* Logo tiles: every logo sits on a light tile in both themes, so dark favicons stay visible. */
.logo { --s: 48px; flex: none; width: var(--s); height: var(--s); border-radius: calc(var(--s) * .24); background: var(--tile); border: 1px solid var(--tile-line); display: grid; place-items: center; overflow: hidden; }
.logo img { width: 74%; height: 74%; object-fit: contain; border-radius: calc(var(--s) * .1); }
.logo.full img { width: 100%; height: 100%; border-radius: 0; }
.logo.mono { border-color: transparent; font-family: var(--display); font-weight: 700; font-size: calc(var(--s) * .42); letter-spacing: -0.03em; }
.logo.mono[data-section="people"] { background: var(--m-people); color: var(--m-people-ink); }
.logo.mono[data-section="tools"] { background: var(--m-tools); color: var(--m-tools-ink); }
.logo.mono[data-section="data"] { background: var(--m-data); color: var(--m-data-ink); }
.logo.mono[data-section="environments"] { background: var(--m-environments); color: var(--m-environments-ink); }
.logo.mono[data-section="trackers"] { background: var(--m-trackers); color: var(--m-trackers-ink); }

/* Search */
.search { position: relative; display: flex; align-items: center; }
.search svg { position: absolute; left: 13px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.search input { width: 100%; height: 42px; padding: 0 14px 0 38px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: 400 15px var(--sans); }
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--ink-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 12%, transparent); }
.empty { padding: 28px 0 8px; color: var(--ink-2); }
.empty button { font: inherit; color: var(--ink); background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Footer */
.site-foot { margin-top: 88px; border-top: 1px solid var(--line); padding-block: 28px 40px; color: var(--ink-2); font-size: 14.5px; }
.site-foot .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.site-foot .brand { font-size: 16px; }
.site-foot .brand svg { width: 22px; height: 22px; }
.site-foot p { margin: 0; flex: 1 1 auto; }
.site-foot nav { display: flex; gap: 8px 20px; flex-wrap: wrap; }
.site-foot nav a { text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.site-foot nav a:hover { text-decoration-color: currentColor; color: var(--ink); }
/* Pinned: one line stuck to the bottom of the screen; the header already carries the brand. On a
   page shorter than the screen it still sits at the bottom. */
body:has(> .site-foot.pinned) { min-height: 100svh; display: flex; flex-direction: column; }
body:has(> .site-foot.pinned) > main { flex: 1 0 auto; }
.site-foot.pinned { position: sticky; bottom: 0; z-index: 14; margin-top: 64px; padding-block: 11px calc(11px + env(safe-area-inset-bottom, 0px)); font-size: 13px; background: color-mix(in srgb, var(--paper) 90%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); }
.site-foot.pinned .wrap { flex-wrap: nowrap; gap: 24px; }
.site-foot.pinned .brand { display: none; }
.site-foot.pinned p { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-foot.pinned nav { flex: none; flex-wrap: nowrap; gap: 18px; }
@media (max-width: 760px) {
  .site-foot.pinned p { display: none; }
  .site-foot.pinned nav { flex: 1 1 auto; justify-content: space-between; gap: 12px; font-size: 12.5px; overflow-x: auto; scrollbar-width: none; }
  .site-foot.pinned nav a { white-space: nowrap; }
}
