/* ============================================================
   LocIX - Local Internet Exchange
   Design System · dark-first, neon-orange, engineer aesthetic
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600;700&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

/* ---------- tokens ---------- */
:root {
  --bg:          #0a0b0e;
  --bg-grid:     rgba(255,255,255,.022);
  --bg-elev:     #101216;
  --surface:     #14171c;
  --surface-2:   #1a1e25;
  --surface-3:   #20252e;
  --border:      rgba(255,255,255,.085);
  --border-2:    rgba(255,255,255,.15);
  --text:        #eceef2;
  --text-dim:    #969ca8;
  --text-faint:  #5e6471;

  --orange:      #f7951d;
  --orange-br:   #ffac3a;
  --orange-dim:  rgba(247,149,29,.13);
  --orange-line: rgba(247,149,29,.32);
  --orange-glow: rgba(247,149,29,.45);

  --ok:          #35d39a;
  --ok-dim:      rgba(53,211,154,.14);

  --s-1g:        #717784;
  --s-10g:       #3bbdf5;
  --s-25g:       #a78bfa;
  --s-40g:       #c084fc;
  --s-100g:      #f7951d;

  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --sans: 'IBM Plex Sans', system-ui, sans-serif;
  --disp: 'Space Grotesk', system-ui, sans-serif;

  --maxw: 1240px;
  --radius: 4px;
  --radius-lg: 8px;
  --header-h: 68px;
}

[data-theme="light"] {
  --bg:          #f4f5f7;
  --bg-grid:     rgba(0,0,0,.035);
  --bg-elev:     #ffffff;
  --surface:     #ffffff;
  --surface-2:   #f5f6f8;
  --surface-3:   #eceef1;
  --border:      rgba(10,12,18,.12);
  --border-2:    rgba(10,12,18,.22);
  --text:        #14171c;
  --text-dim:    #565d68;
  --text-faint:  #8b919c;
  --orange-dim:  rgba(247,149,29,.12);
  --s-1g:        #6b7280;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background .35s ease, color .35s ease;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
table { border-collapse: collapse; width: 100%; }
::selection { background: var(--orange); color: #0a0b0e; }

/* grid-paper backdrop */
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

/* ---------- layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 28px; position: relative; z-index: 1; }
.section { padding: 92px 0; position: relative; z-index: 1; }
.section--tight { padding: 56px 0; }
main { position: relative; z-index: 1; min-height: 60vh; }

/* ---------- mono labels / eyebrows ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--orange);
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.eyebrow::before {
  content: "";
  width: 22px; height: 1px;
  background: var(--orange-line);
}
.eyebrow--plain { color: var(--text-faint); }
.eyebrow--plain::before { background: var(--border-2); }

.kicker {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--text-faint);
}

/* ---------- type ---------- */
h1,h2,h3,h4 { font-family: var(--disp); font-weight: 600; line-height: 1.06; letter-spacing: -.02em; color: var(--text); }
.h-xl { font-size: clamp(2.6rem, 6vw, 5rem); font-weight: 600; }
.h-lg { font-size: clamp(2rem, 4vw, 3.1rem); }
.h-md { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
.h-sm { font-size: 1.25rem; }
.lead { font-size: clamp(1.05rem, 1.5vw, 1.3rem); color: var(--text-dim); line-height: 1.55; max-width: 60ch; }
.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.mono { font-family: var(--mono); }
.amber { color: var(--orange); }

/* ============================================================
   HEADER / NAV
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand img { width: 34px; height: 34px; }
.brand .brand-light { display: none; }
[data-theme="light"] .brand .brand-dark { display: none; }
[data-theme="light"] .brand .brand-light { display: block; }
.brand .wordmark {
  font-family: var(--disp); font-weight: 700; font-size: 21px;
  letter-spacing: -.02em; color: var(--text);
}
.brand .wordmark b { color: var(--orange); font-weight: 700; }

.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-item { position: relative; }
.nav-link {
  font-family: var(--mono); font-size: 13px; font-weight: 500;
  color: var(--text-dim); padding: 9px 14px; border-radius: var(--radius);
  display: inline-flex; align-items: center; gap: 6px; transition: color .15s, background .15s;
  white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link.is-active { color: var(--orange); }
.nav-link .caret { font-size: 9px; opacity: .6; transition: transform .2s; }
.nav-item:hover .caret { transform: rotate(180deg); }

.dropdown {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 200px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 6px; opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: all .18s ease; box-shadow: 0 18px 50px rgba(0,0,0,.5);
}
.nav-item:hover .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown a {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: var(--radius);
  font-family: var(--mono); font-size: 13px; color: var(--text-dim); transition: all .14s;
}
.dropdown a:hover { background: var(--surface-2); color: var(--text); }
.dropdown a .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--orange); flex-shrink: 0; }

.header-tools { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.theme-toggle {
  width: 36px; height: 36px; border-radius: var(--radius); border: 1px solid var(--border);
  display: grid; place-items: center; color: var(--text-dim); transition: all .15s; background: var(--surface);
}
.theme-toggle:hover { color: var(--orange); border-color: var(--orange-line); }
.theme-toggle svg { width: 17px; height: 17px; }
[data-theme="light"] .theme-toggle .i-sun { display: none; }
.theme-toggle .i-moon { display: none; }
[data-theme="light"] .theme-toggle .i-moon { display: block; }

.menu-toggle { display: none; width: 38px; height: 38px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); place-items: center; background: var(--surface); }
.menu-toggle svg { width: 20px; height: 20px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px; justify-content: center;
  font-family: var(--mono); font-size: 13.5px; font-weight: 500;
  padding: 12px 22px; border-radius: var(--radius); transition: all .16s ease;
  border: 1px solid transparent; white-space: nowrap; letter-spacing: .01em;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--orange); color: #0a0b0e; font-weight: 600; }
.btn-primary:hover { background: var(--orange-br); box-shadow: 0 0 0 1px var(--orange), 0 8px 30px var(--orange-glow); transform: translateY(-1px); }
.btn-ghost { border-color: var(--border-2); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--orange-line); color: var(--orange); background: var(--orange-dim); }
.btn-sm { padding: 8px 14px; font-size: 12.5px; }

/* ---------- badges / pills ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 11.5px; font-weight: 600;
  padding: 3px 9px; border-radius: 100px; border: 1px solid var(--border-2);
  color: var(--text-dim); letter-spacing: .03em;
}
.badge--ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: var(--ok-dim); }
.badge--amber { color: var(--orange); border-color: var(--orange-line); background: var(--orange-dim); }

.speed {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 11.5px; font-weight: 600;
  padding: 2px 8px; border-radius: 3px; letter-spacing: .02em; min-width: 44px;
  border: 1px solid currentColor; background: color-mix(in srgb, currentColor 11%, transparent);
}
.speed--1g   { color: var(--s-1g); }
.speed--10g  { color: var(--s-10g); }
.speed--25g  { color: var(--s-25g); }
.speed--40g  { color: var(--s-40g); }
.speed--100g { color: var(--s-100g); }

/* status dot */
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); position: relative; flex-shrink: 0; }
.status-dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid var(--ok); opacity: .5; animation: ping 2.4s cubic-bezier(0,0,.2,1) infinite; }
@keyframes ping { 0% { transform: scale(.6); opacity: .7; } 80%,100% { transform: scale(1.9); opacity: 0; } }

/* ---------- cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  position: relative; transition: border-color .2s, transform .2s, background .2s;
}
.card:hover { border-color: var(--border-2); }
.card-pad { padding: 26px; }

/* corner crosshair decoration */
.crosshair { position: relative; }
.crosshair::before, .crosshair::after {
  content: ""; position: absolute; width: 9px; height: 9px; pointer-events: none;
  border-color: var(--orange-line); border-style: solid;
}
.crosshair::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.crosshair::after  { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }

/* ---------- tables ---------- */
.tbl-wrap { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.tbl-scroll { overflow-x: auto; }
table.data { font-family: var(--mono); font-size: 13px; }
table.data thead th {
  text-align: left; padding: 13px 16px; font-weight: 600; font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-faint); background: var(--surface-2);
  border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; z-index: 2;
  cursor: default; user-select: none;
}
table.data thead th.sortable { cursor: pointer; transition: color .15s; }
table.data thead th.sortable:hover { color: var(--text); }
table.data thead th .arrow { opacity: 0; margin-left: 5px; color: var(--orange); }
table.data thead th.sorted .arrow { opacity: 1; }
table.data tbody td { padding: 11px 16px; border-bottom: 1px solid var(--border); color: var(--text-dim); white-space: nowrap; vertical-align: middle; }
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tbody tr:last-child td { border-bottom: none; }
table.data .asn { color: var(--orange); font-weight: 500; }
table.data .member-name { color: var(--text); font-family: var(--sans); font-weight: 500; }
table.data .ip { color: var(--text-dim); }
table.data .ip6 { color: var(--text-faint); }

/* ---------- search / filter bar ---------- */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.search {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 240px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0 14px; height: 44px; transition: border-color .15s;
}
.search:focus-within { border-color: var(--orange-line); }
.search svg { width: 16px; height: 16px; color: var(--text-faint); flex-shrink: 0; }
.search input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-family: var(--mono); font-size: 14px; }
.search input::placeholder { color: var(--text-faint); }
.filter-group { display: flex; gap: 6px; }
.chip {
  font-family: var(--mono); font-size: 12.5px; padding: 8px 13px; border-radius: var(--radius);
  border: 1px solid var(--border); color: var(--text-dim); transition: all .14s; background: var(--surface);
}
.chip:hover { color: var(--text); border-color: var(--border-2); }
.chip.is-active { background: var(--orange); color: #0a0b0e; border-color: var(--orange); font-weight: 600; }
.result-count { font-family: var(--mono); font-size: 12.5px; color: var(--text-faint); margin-left: auto; }

/* ---------- stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.stat { background: var(--surface); padding: 28px 24px; }
.stat .num { font-family: var(--disp); font-size: clamp(2rem, 3.2vw, 2.9rem); font-weight: 600; color: var(--text); line-height: 1; letter-spacing: -.02em; }
.stat .num .unit { color: var(--orange); font-size: .55em; }
.stat .lbl { font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); margin-top: 11px; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-elev); position: relative; z-index: 1; padding: 56px 0 32px; margin-top: 40px; }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 40px; border-bottom: 1px solid var(--border); }
.footer-brand .wordmark { font-family: var(--disp); font-weight: 700; font-size: 22px; }
.footer-brand .wordmark b { color: var(--orange); }
.footer-brand p { color: var(--text-dim); font-size: 14px; margin-top: 14px; max-width: 32ch; }
.footer-col h5 { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 16px; font-weight: 600; }
.footer-col a { display: block; font-size: 14px; color: var(--text-dim); padding: 5px 0; transition: color .14s; }
.footer-col a:hover { color: var(--orange); }
.footer-bottom { display: flex; justify-content: center; align-items: center; padding-top: 24px; flex-wrap: wrap; gap: 12px; text-align: center; }
.footer-bottom span { font-family: var(--mono); font-size: 12px; color: var(--text-faint); }

/* ---------- generic prose ---------- */
.prose p { color: var(--text-dim); margin-bottom: 18px; line-height: 1.7; }
.prose strong { color: var(--text); font-weight: 600; }
.prose a { color: var(--orange); border-bottom: 1px solid var(--orange-line); }
.prose a:hover { border-color: var(--orange); }
.prose ul { list-style: none; margin: 18px 0; display: flex; flex-direction: column; gap: 12px; }
.prose ul li { position: relative; padding-left: 26px; color: var(--text-dim); line-height: 1.6; }
.prose ul li::before { content: ""; position: absolute; left: 4px; top: 10px; width: 7px; height: 7px; background: var(--orange); border-radius: 1px; }

/* ---------- info banner ---------- */
.banner {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px;
  background: var(--orange-dim); border: 1px solid var(--orange-line); border-radius: var(--radius);
  font-size: 14px; color: var(--text);
}
.banner svg { width: 18px; height: 18px; color: var(--orange); flex-shrink: 0; }
.banner a { color: var(--orange); font-weight: 600; }

/* ---------- page hero (inner pages) ---------- */
.page-hero { padding: 64px 0 36px; border-bottom: 1px solid var(--border); position: relative; z-index: 1; }
.breadcrumb { display: flex; align-items: center; gap: 9px; font-family: var(--mono); font-size: 12.5px; color: var(--text-faint); margin-bottom: 20px; }
.breadcrumb a { color: var(--text-faint); transition: color .14s; }
.breadcrumb a:hover { color: var(--orange); }
.breadcrumb .sep { opacity: .5; }

/* location sub-tabs (members/sites/connect) */
.subtabs { display: flex; gap: 4px; margin-top: 26px; border-bottom: 1px solid var(--border); }
.subtab {
  font-family: var(--mono); font-size: 13px; padding: 12px 18px; color: var(--text-dim);
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all .15s; display: inline-flex; align-items: center; gap: 8px;
}
.subtab:hover { color: var(--text); }
.subtab.is-active { color: var(--orange); border-bottom-color: var(--orange); }

/* utility */
.flex { display: flex; }
.between { justify-content: space-between; }
.items-center { align-items: center; }
.gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.wrap { flex-wrap: wrap; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-40 { margin-top: 40px; } .mt-56{margin-top:56px;}
.mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; } .mb-40 { margin-bottom: 40px; } .mb-56 { margin-bottom: 56px; }
.center { text-align: center; }
.hide { display: none !important; }

/* ---------- mobile ---------- */
@media (max-width: 880px) {
  .menu-toggle { display: grid; }
  /* nav removed from flow -> push the theme/menu buttons to the right edge */
  .header-tools { margin-left: auto; }
  .nav {
    position: fixed; top: var(--header-h); left: 0; right: 0;
    /* size by height (the header's backdrop-filter makes it the containing block,
       so bottom:0 would collapse it) */
    height: calc(100vh - var(--header-h)); height: calc(100dvh - var(--header-h));
    flex-direction: column; align-items: stretch; gap: 2px; padding: 18px;
    background: var(--bg); border-top: 1px solid var(--border); overflow-y: auto;
    margin: 0; z-index: 50;
    /* in-viewport hide (no off-canvas translateX -> no horizontal overflow) */
    opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-6px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
  }
  .nav.open { opacity: 1; visibility: visible; pointer-events: auto; transform: none; }
  .nav-link { padding: 14px; font-size: 15px; }
  .dropdown { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: none; background: var(--surface); margin: 2px 0 6px; padding: 4px; }
  .nav-item:hover .caret { transform: none; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 28px; }
  .section { padding: 64px 0; }
}
@media (max-width: 540px) {
  .footer-top { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .container { padding: 0 18px; }
}
