/* setup.kg3.io: dark slate, JetBrains Mono, accents pulled from the KG3 neon logo */
:root {
  --bg: #020617;
  --panel: #0a1122;
  --panel-2: #0f172a;
  --line: #1e293b;
  --line-2: #334155;
  --text: #e2e8f0;
  --dim: #94a3b8;
  --mute: #64748b;
  --yellow: #f2e81a;
  --blue: #5aa7dc;
  --green: #6cbf44;
  --red: #f87171;
  --amber: #fbbf24;
  --radius: 10px;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.55 var(--mono);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; }
img { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; flex: 1; }

/* ---------- top bar ---------- */
.topbar {
  width: 100%; max-width: 1080px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { height: 32px; width: auto; }
.brand-tag { color: var(--mute); font-size: 13px; letter-spacing: .02em; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who form { margin: 0; }
.avatar { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-2); }
.who-name { color: var(--dim); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 12ch; }
.link-btn {
  font: inherit; font-size: 13px; color: var(--mute); background: none; border: 0; padding: 4px 0; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
}
.link-btn:hover { color: var(--text); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: 500 14px/1 var(--mono);
  color: var(--text); text-decoration: none;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 10px 14px;
  transition: border-color .15s, background .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--dim); background: #131d33; }
.btn-sm { padding: 7px 11px; font-size: 13px; }
.btn-lg { padding: 13px 18px; font-size: 15px; }
.btn-primary {
  color: var(--bg); background: var(--yellow); border-color: var(--yellow); font-weight: 700;
  box-shadow: 0 0 0 0 rgba(242, 232, 26, 0);
}
.btn-primary:hover { background: #fff35a; border-color: #fff35a; box-shadow: 0 0 24px rgba(242, 232, 26, .35); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn .ico path { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.btn .g { width: 18px; height: 18px; background: #fff; border-radius: 50%; padding: 2px; }
.text-link { color: var(--blue); font-size: 13px; text-decoration: none; }
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- hero ---------- */
.hero { padding: 40px 0 28px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.hero-hub { padding-bottom: 24px; border-bottom: 0; margin-bottom: 0; }
.eyebrow { margin: 0 0 12px; color: var(--green); font-size: 13px; letter-spacing: .04em; overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(28px, 5.4vw, 46px); line-height: 1.12; font-weight: 700; letter-spacing: -.02em; }
.hl { color: var(--yellow); text-shadow: 0 0 22px rgba(242, 232, 26, .35); }
.lede { margin: 14px 0 0; color: var(--dim); max-width: 60ch; }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 26px; }
.hint { color: var(--mute); font-size: 13px; }
.jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.jump a {
  font-size: 12px; color: var(--dim); text-decoration: none;
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px;
}
.jump a:hover { color: var(--text); border-color: var(--line-2); }

/* ---------- sections ---------- */
.group { padding: 30px 0 6px; scroll-margin-top: 12px; }
.group-head { margin-bottom: 16px; }
.group-head h2 { margin: 0; font-size: 18px; font-weight: 700; }
.group-head p { margin: 6px 0 0; color: var(--mute); font-size: 13px; max-width: 72ch; }
.group-head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; }

/* KG3 app cards */
.app-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.app-card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-top: 2px solid var(--yellow);
  border-radius: var(--radius);
  padding: 18px;
  display: flex; flex-direction: column; gap: 10px;
}
.app-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.app-card h3 { margin: 0; font-size: 17px; }
.app-card p { margin: 0; color: var(--dim); font-size: 14px; flex: 1; }
.meta { color: var(--mute); font-size: 12px; }
.app-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 6px; }

/* vendor tool rows */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 8px; }
.tool {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel);
  text-decoration: none;
  transition: border-color .15s, background .15s;
  min-width: 0;
}
.tool:hover { border-color: var(--blue); background: var(--panel-2); }
.tool-main { display: flex; flex-direction: column; min-width: 0; }
.tool-name { font-weight: 500; font-size: 14px; }
.tool-desc { color: var(--mute); font-size: 12.5px; }
.tool-host { color: var(--mute); font-size: 12px; white-space: nowrap; flex: none; }
.tool:hover .tool-host { color: var(--blue); }

/* ---------- hub ---------- */
.crew-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.crew-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start;
  border-left: 3px solid var(--line-2);
}
.crew-card h3 { margin: 0; font-size: 16px; }
.crew-card p { margin: 0; color: var(--dim); font-size: 13.5px; flex: 1; }
.accent-blue { border-left-color: var(--blue); }
.accent-blue .btn { border-color: var(--blue); color: var(--blue); }
.accent-blue .btn:hover { box-shadow: 0 0 18px rgba(90, 167, 220, .3); }
.accent-green { border-left-color: var(--green); }
.accent-green .btn { border-color: var(--green); color: var(--green); }
.accent-green .btn:hover { box-shadow: 0 0 18px rgba(108, 191, 68, .3); }
.accent-yellow { border-left-color: var(--yellow); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.toolbar input {
  font: inherit; font-size: 14px; color: var(--text);
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 8px;
  padding: 9px 12px; width: 220px; max-width: 100%;
}
.toolbar input::placeholder { color: var(--mute); }
.toolbar input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(90, 167, 220, .2); }
.summary { color: var(--dim); font-size: 13px; }

.site-group { margin-top: 22px; }
.site-group h3 {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 8px; font-size: 13px; font-weight: 500; color: var(--dim);
  text-transform: uppercase; letter-spacing: .08em;
}
.count { color: var(--mute); font-weight: 400; }
.tag {
  text-transform: none; letter-spacing: 0; font-size: 11px; color: var(--amber);
  border: 1px solid rgba(251, 191, 36, .35); border-radius: 999px; padding: 1px 8px;
}
.sites { width: 100%; table-layout: fixed; border-collapse: collapse; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.sites th {
  text-align: left; font-size: 11px; font-weight: 500; color: var(--mute); text-transform: uppercase; letter-spacing: .08em;
  padding: 9px 14px; background: var(--panel-2); border-bottom: 1px solid var(--line);
}
.sites td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.sites tr:last-child td { border-bottom: 0; }
.sites tbody tr { background: var(--panel); transition: background .12s; }
.sites tbody tr:hover { background: var(--panel-2); }
.c-app { width: 32%; overflow-wrap: anywhere; }
.c-app a { display: flex; flex-direction: column; text-decoration: none; }
.s-name { font-weight: 500; font-size: 14px; }
.c-app a:hover .s-name { color: var(--yellow); }
.s-host { color: var(--blue); font-size: 12px; }
.c-desc { color: var(--dim); font-size: 13px; }
.c-status { width: 160px; text-align: right; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; white-space: nowrap; color: var(--dim);
  border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 10px;
}
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--mute); flex: none; }
.pill-wait::before { animation: pulse 1.1s ease-in-out infinite; }
.pill-up, .pill-gated { color: var(--green); border-color: rgba(108, 191, 68, .4); }
.pill-up::before, .pill-gated::before { background: var(--green); box-shadow: 0 0 8px var(--green); }
.pill-missing { color: var(--amber); border-color: rgba(251, 191, 36, .4); }
.pill-missing::before { background: var(--amber); }
.pill-down { color: var(--red); border-color: rgba(248, 113, 113, .45); }
.pill-down::before { background: var(--red); box-shadow: 0 0 8px var(--red); }
@keyframes pulse { 50% { opacity: .25; } }

.no-match { color: var(--mute); padding: 20px 0; }

/* ---------- footer ---------- */
.foot {
  width: 100%; max-width: 1080px; margin: 48px auto 0;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px;
  padding: 22px 16px 32px; border-top: 1px solid var(--line);
  color: var(--mute); font-size: 12px;
}
.foot a { color: var(--dim); text-decoration: none; }
.foot a:hover { color: var(--text); }

/* ---------- phones ---------- */
@media (max-width: 720px) {
  body { font-size: 14px; }
  .hero { padding-top: 24px; }
  .brand img { height: 28px; }
  .who-name { display: none; }
  .tool { flex-direction: column; align-items: flex-start; gap: 4px; }
  .toolbar, .toolbar input { width: 100%; }

  .sites, .sites tbody { display: block; border: 0; }
  .sites thead { display: none; }
  .sites tbody tr {
    display: grid; grid-template-columns: 1fr auto; gap: 4px 12px;
    border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; padding: 11px 12px;
  }
  .sites td { padding: 0; border: 0; width: auto; }
  .c-app { grid-column: 1; grid-row: 1; min-width: 0; }
  .c-status { grid-column: 2; grid-row: 1; text-align: right; }
  .c-desc { grid-column: 1 / -1; grid-row: 2; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}

/* coming soon + downloads */
.app-soon { border-top-color: var(--line-2); }
.app-soon h3 { color: var(--dim); }
.soon-badge {
  font-size: 12px; color: var(--yellow);
  border: 1px dashed rgba(242, 232, 26, .5); border-radius: 8px; padding: 9px 14px;
}
.app-actions .tag { margin-left: auto; }
