/* erlcdirectory.com. Builds on site.css (tokens, header, footer). One accent: the live marks.
   Own type: Schibsted Grotesk (a newsroom grotesk, sharper than Geist at display sizes) with
   IBM Plex Mono for ranks and counts. */
@font-face { font-family: "Schibsted Grotesk"; src: url(/fonts/SchibstedGrotesk-Var.woff2) format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url(/fonts/IBMPlexMono-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url(/fonts/IBMPlexMono-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
body.dir { --sans: "Schibsted Grotesk", ui-sans-serif, system-ui, sans-serif; --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-family: var(--sans); }
.dir input, .dir button { font-family: var(--sans); }
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .28s; animation-timing-function: var(--ease); }
::view-transition-group(dtabs) { animation-duration: .4s; animation-timing-function: var(--ease); }

.dir main { padding-top: 0; }
.d-brand .mark { color: var(--ink); }
.d-brand:hover .mark rect:nth-child(2) { transform: scaleX(.75); }
.d-brand .mark rect { transform-box: fill-box; transform-origin: left center; transition: transform .35s var(--ease); }

/* ---- Hero ---- */
.d-hero { padding: clamp(48px, 10vw, 112px) 0 clamp(28px, 5vw, 48px); max-width: 860px; }
.d-hero-sm { padding: clamp(36px, 7vw, 72px) 0 20px; }
.d-title { font-size: clamp(40px, 7.6vw, 84px); line-height: .96; letter-spacing: -.035em; font-weight: 700; margin: 0 0 22px; text-wrap: balance; }
.d-hero-sm .d-title { font-size: clamp(32px, 5.4vw, 52px); margin-bottom: 12px; }
.d-lede { color: var(--ink-2); font-size: clamp(16px, 1.7vw, 19px); max-width: 58ch; margin: 0; }
.d-lede a { color: var(--ink); }
.d-live { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 28px; font: 13px/1 var(--mono); color: var(--ink-2); }
.d-live span span { color: var(--ink-3); }
.d-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--acc); position: relative; }
.d-live i::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid var(--acc); animation: d-ping 2.4s var(--ease) infinite; }
@keyframes d-ping { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.8); opacity: 0; } }

.d-stats { display: grid; grid-template-columns: repeat(3, minmax(0, max-content)); gap: 0; margin: 40px 0 0; border-top: 1px solid var(--rule); }
.d-stats div { padding: 18px 40px 0 0; margin-right: 40px; border-right: 1px solid var(--rule); }
.d-stats div:last-child { border-right: 0; margin-right: 0; }
.d-stats dt { font-size: 13px; color: var(--ink-3); margin-bottom: 6px; }
.d-stats dd { margin: 0; font: 500 clamp(24px, 3.4vw, 34px)/1 var(--mono); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

/* Entrance: each block rises in turn. */
.d-in { animation: d-rise .9s var(--ease) both; }
.d-hero > .d-in:nth-child(2) { animation-delay: .07s; }
.d-hero > .d-in:nth-child(3) { animation-delay: .14s; }
.d-hero > .d-in:nth-child(4) { animation-delay: .21s; }
@keyframes d-rise { from { opacity: 0; transform: translateY(18px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }

/* ---- Icon strip ---- */
.d-strip { position: relative; margin: 8px calc(50% - 50vw) 8px; padding: 6px 0; overflow: hidden; display: grid; gap: 12px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  animation: d-rise 1.2s .3s var(--ease) both; }
.d-track { display: flex; gap: 12px; width: max-content; animation: d-slide 90s linear infinite; }
.d-rev { animation-direction: reverse; animation-duration: 110s; }
.d-strip:hover .d-track { animation-play-state: paused; }
.d-track img { width: 56px; height: 56px; border-radius: 14px; background: var(--bg-2); outline: 1px solid var(--rule); outline-offset: -1px; filter: grayscale(1) brightness(.8); transition: filter .4s, transform .4s var(--ease); }
.d-track img:hover { filter: none; transform: translateY(-3px); }
@keyframes d-slide { to { transform: translateX(-50%); } }

/* ---- Tabs + search ---- */
.d-bar { position: sticky; top: 56px; z-index: 15; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 28px; background: rgba(11, 11, 12, .92); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--rule); }
.d-tabs { display: flex; overflow-x: auto; scrollbar-width: none; }
.d-tabs a { position: relative; display: inline-flex; align-items: baseline; gap: 7px; padding: 16px 14px 15px; color: var(--ink-3); text-decoration: none; white-space: nowrap; font-size: 15px; transition: color .2s; }
.d-tabs a:first-child { padding-left: 0; }
.d-tabs a:hover { color: var(--ink); }
.d-tabs a span { font: 12px/1 var(--mono); color: var(--ink-3); transition: color .2s; }
.d-tabs a[aria-current="page"] { color: var(--ink); }
.d-tabs a[aria-current="page"] span { color: var(--acc); }
.d-tabs a[aria-current="page"]::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px; background: var(--ink); view-transition-name: dtabs; }
.d-tabs a:first-child[aria-current="page"]::after { left: 0; }
.d-search { position: relative; display: flex; align-items: center; flex: 0 1 280px; color: var(--ink-3); }
.d-search svg { position: absolute; left: 12px; pointer-events: none; }
.d-search input { width: 100%; height: 36px; padding: 0 34px 0 34px; border-radius: 8px; border: 1px solid var(--rule-2); background: var(--bg-2); color: var(--ink); font: 14px var(--sans); transition: border-color .2s, background-color .2s; }
.d-search input::placeholder { color: var(--ink-3); }
.d-search input:focus { outline: none; border-color: var(--rule-3); background: var(--bg-3); }
.d-search kbd { position: absolute; right: 9px; font: 11px/1 var(--mono); color: var(--ink-3); border: 1px solid var(--rule-2); border-radius: 4px; padding: 3px 5px; pointer-events: none; }
.d-search input:focus ~ kbd { opacity: 0; }
.d-note { color: var(--ink-2); font-size: 14px; margin: 18px 0 0; }

/* ---- Ranked list ---- */
.d-head, .d-row { display: grid; grid-template-columns: 34px 40px minmax(0, 1fr) 140px 84px 74px 64px; align-items: center; column-gap: 16px; }
.d-head { padding: 18px 12px 10px; font-size: 12px; color: var(--ink-3); }
.d-head span:nth-child(1) { grid-column: 1; }
.d-head span:nth-child(2) { grid-column: 2 / 4; }
.d-head span:nth-child(4), .d-head span:nth-child(5) { text-align: right; }
.d-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.d-row { position: relative; padding: 12px; border-bottom: 1px solid var(--rule); transition: background-color .2s; }
.d-row:hover { background: var(--bg-2); }
.d-row:has(.d-link:focus-visible) { outline: 2px solid var(--ink); outline-offset: -2px; }
.d-rk { font: 13px/1 var(--mono); color: var(--ink-3); font-variant-numeric: tabular-nums; transition: color .2s; }
.d-row:hover .d-rk { color: var(--acc); }
.d-ico { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; background: var(--bg-3); transition: transform .35s var(--ease); }
.d-row:hover .d-ico { transform: scale(1.06) rotate(-2deg); }
.d-ph { display: grid; place-items: center; font: 500 13px/1 var(--mono); color: var(--ink-2); border: 1px solid var(--rule); }
.d-nm { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.d-link { font-weight: 600; font-size: 15.5px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.01em; }
.d-link::after { content: ""; position: absolute; inset: 0; }
.d-link:focus-visible { outline: none; }
.d-sub { font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-about { color: var(--ink-3); opacity: .8; }
.d-size { height: 2px; background: var(--rule); border-radius: 2px; overflow: hidden; }
.d-size i { display: block; height: 100%; width: 0; background: var(--ink-2); border-radius: 2px; transition: width 1.1s var(--ease), background-color .2s; }
.d-row:hover .d-size i { background: var(--ink); }
.d-mem, .d-on { font: 14px/1 var(--mono); text-align: right; font-variant-numeric: tabular-nums; }
.d-on { color: var(--ink-2); display: inline-flex; justify-content: flex-end; align-items: center; gap: 7px; }
.d-on i { width: 6px; height: 6px; border-radius: 50%; background: #3ecf8e; }
.d-join { justify-self: end; display: inline-flex; align-items: center; gap: 5px; font-size: 14px; color: var(--ink-2); transition: color .2s; }
.d-join svg { transition: transform .3s var(--ease); }
.d-row:hover .d-join { color: var(--ink); }
.d-row:hover .d-join svg { transform: translate(2px, -2px); }

/* Rows slide in as they scroll into view (dir.js adds .js / .in). */
.js .d-row { opacity: 0; transform: translateY(10px); }
.js .d-row.in { opacity: 1; transform: none; transition: opacity .6s var(--ease), transform .6s var(--ease), background-color .2s; }

.d-empty { padding: 64px 0; border-bottom: 1px solid var(--rule); }
.d-empty-big { font-size: clamp(24px, 3.6vw, 34px); letter-spacing: -.03em; margin: 0 0 8px; }
.d-empty p:last-child { color: var(--ink-2); margin: 0; }

.d-pages { display: flex; align-items: center; justify-content: space-between; margin: 28px 0 0; }
.d-pg { font: 13px/1 var(--mono); color: var(--ink-3); }
.d-btn { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: 8px; background: var(--ink); color: var(--bg); font-weight: 500; text-decoration: none; transition: transform .15s var(--ease), background-color .2s, border-color .2s; }
.d-btn:active { transform: scale(.97); }
.d-ghost { background: transparent; color: var(--ink); border: 1px solid var(--rule-2); }
.d-ghost:hover { border-color: var(--rule-3); }

@media (max-width: 860px) {
  .d-head, .d-row { grid-template-columns: 26px 40px minmax(0, 1fr) 72px 20px; column-gap: 12px; }
  .d-size, .d-on, .d-h-bar, .d-head span:nth-child(5) { display: none; }
  .d-join { font-size: 0; gap: 0; }
  .d-about { display: none; }
  .d-bar { flex-direction: column; align-items: stretch; gap: 0; padding-bottom: 10px; }
  .d-search { flex: none; }
  .d-search kbd { display: none; }
  .d-stats div { padding-right: 20px; margin-right: 20px; }
}
@media (max-width: 520px) {
  .d-stats { grid-template-columns: 1fr 1fr; }
  .d-stats div:nth-child(2) { border-right: 0; margin-right: 0; }
  .d-stats div:nth-child(3) { grid-column: 1 / -1; padding-top: 14px; }
  .d-mem { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .d-in, .d-strip, .d-track, .d-live i::after { animation: none !important; }
  .js .d-row { opacity: 1; transform: none; }
  .d-size i { transition: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
.d-brand span { white-space: nowrap; font-weight: 700; letter-spacing: -.02em; }
@media (max-width: 560px) { .dir .top nav { display: none; } .d-bar { top: 56px; } }

/* Front page: a wall of server icons fills the whole first screen behind the title. On scroll
   (dir.js sets --p from 0 to 1) the wall zooms and drifts while the words lift away. */
.d-top { --p: 0; position: relative; margin-inline: calc(50% - 50vw); min-height: calc(100svh - 56px); display: grid; place-items: center; overflow: hidden; isolation: isolate; border-bottom: 1px solid var(--rule); }
.d-bg { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.d-wall { position: absolute; left: 50%; top: 50%; width: 160vw; display: grid; gap: 16px;
  transform: translate(-50%, -50%) rotate(-8deg) scale(calc(1 + var(--p) * .22)) translateY(calc(var(--p) * 90px));
  animation: d-fade 1.4s var(--ease) both; will-change: transform; }
.d-wall .d-track { gap: 16px; animation-duration: 140s; }
.d-wall .d-rev { animation-duration: 170s; }
.d-wall .d-track:nth-child(4n+2) { animation-duration: 120s; }
.d-wall .d-track:nth-child(4n+3) { animation-duration: 190s; }
.d-wall img { width: 72px; height: 72px; border-radius: 18px; background: var(--bg-2); flex: none; filter: none; outline: 0; }
/* Readability: dark behind the words, icons at full colour toward the edges, fading into the page below. */
.d-top::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 54% 50% at 50% 50%, rgba(11, 11, 12, .93) 28%, rgba(11, 11, 12, .66) 60%, rgba(11, 11, 12, .1) 100%),
              linear-gradient(to bottom, rgba(11, 11, 12, .35), transparent 18%, transparent 80%, var(--bg));
  opacity: calc(1 - var(--p) * .35); }
.d-top-in { padding: 64px 20px; text-align: center; display: grid; justify-items: center;
  transform: translateY(calc(var(--p) * -70px)) scale(calc(1 - var(--p) * .06)); opacity: calc(1 - var(--p) * 1.3); filter: blur(calc(var(--p) * 6px)); will-change: transform, opacity; }
.d-top .d-title { max-width: 15ch; margin: 0 0 32px; }
.d-top .d-stats { margin: 0; border-top: 0; grid-template-columns: repeat(3, auto); }
.d-top .d-stats div { padding-top: 0; text-align: center; }
.d-top .d-stats div:last-child { padding-right: 0; }
.d-cue { position: absolute; bottom: 22px; left: 50%; width: 1px; height: 40px; background: linear-gradient(var(--ink-3), transparent); transform: translateX(-50%); opacity: calc(1 - var(--p) * 4); animation: d-cue 2.2s var(--ease) infinite; }
@keyframes d-cue { 0% { transform: translateX(-50%) scaleY(0); transform-origin: top; } 50% { transform: translateX(-50%) scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: translateX(-50%) scaleY(0); transform-origin: bottom; } }
@keyframes d-fade { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 560px) {
  .d-wall img { width: 56px; height: 56px; border-radius: 14px; }
  .d-wall { width: 240vw; }
  .d-top .d-stats { grid-template-columns: repeat(3, auto); }
  .d-top .d-stats div { padding-right: 14px; margin-right: 14px; }
  .d-top .d-stats div:nth-child(2) { border-right: 1px solid var(--rule); margin-right: 14px; }
  .d-top .d-stats div:nth-child(3) { grid-column: auto; padding-top: 0; }
  .d-top .d-stats dd { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) { .d-wall, .d-cue { animation: none; } .d-top, .d-top * { --p: 0 !important; } }

/* Paging: count line, numbered pages (no-JS), and the endless-list loader. */
.d-more { display: grid; justify-items: center; gap: 14px; margin-top: 28px; }
.d-count { margin: 0; font: 13px/1 var(--mono); color: var(--ink-3); }
.d-count .d-shown { color: var(--ink-2); }
.d-more .d-pages { display: flex; align-items: center; gap: 4px; margin: 0; }
.d-num, .d-arr { display: inline-grid; place-items: center; min-width: 36px; height: 36px; padding: 0 8px; border-radius: 8px; font: 14px/1 var(--mono); color: var(--ink-2); text-decoration: none; transition: background-color .2s, color .2s; }
a.d-num:hover, a.d-arr:hover { background: var(--bg-2); color: var(--ink); }
.d-num[aria-current] { background: var(--ink); color: var(--bg); }
span.d-arr { opacity: .3; }
.d-gap { color: var(--ink-3); padding: 0 4px; }
.auto .d-pages { display: none; }
.d-load { width: 100%; height: 2px; background: var(--rule); border-radius: 2px; overflow: hidden; max-width: 220px; }
.d-load i { display: block; height: 100%; width: 0; background: var(--ink-2); transition: width .5s var(--ease); }
.d-more.busy .d-load i { animation: d-busy 1s var(--ease-io) infinite; }
@keyframes d-busy { from { transform: translateX(-100%); width: 60%; } to { transform: translateX(200%); width: 60%; } }
