/* PureXit design system — restrained dark interface.
   One accent color, thin borders, precise type, purposeful motion. */

:root {
  --bg: #0b0c0f;
  --bg-raised: #101218;
  --bg-panel: #13151c;
  --bg-hover: #181b23;
  --border: #23262f;
  --border-strong: #2e323d;
  --text: #e6e8ee;
  --text-dim: #9aa0ae;
  --text-faint: #6b7180;
  --accent: #7a83ff;
  --accent-dim: #5d66e0;
  --accent-soft: rgba(122, 131, 255, 0.12);
  --success: #4ade80;
  --warning: #fbbf24;
  --danger: #f87171;
  --radius: 8px;
  --radius-sm: 6px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "Segoe UI Mono", Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  color-scheme: dark;
  background: var(--bg);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

::selection { background: var(--accent-soft); }

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------- Navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 12, 15, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; gap: 28px;
  height: 60px;
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 16px; letter-spacing: -0.01em;
}
.nav-brand .logo-mark {
  width: 26px; height: 26px; border-radius: 7px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
  display: grid; place-items: center;
  font-size: 13px; font-weight: 800; color: #fff;
}
.logo-img { object-fit: cover; border: 1px solid var(--border); background: #fff; }
.nav-links { display: flex; gap: 4px; flex: 1; }
.nav-links a {
  padding: 6px 12px; border-radius: var(--radius-sm);
  font-size: 14px; color: var(--text-dim);
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover { color: var(--text); background: var(--bg-hover); }
.nav-links a.active { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 10px; }

.nav-user { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-dim); }
.nav-user img { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500;
  border: 1px solid transparent; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dim); }
.btn-secondary { background: var(--bg-panel); border-color: var(--border-strong); color: var(--text); }
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--text-faint); }
.btn-ghost { color: var(--text-dim); }
.btn-ghost:hover { color: var(--text); background: var(--bg-hover); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: rgba(248, 113, 113, 0.1); }
.btn-lg { padding: 11px 22px; font-size: 15px; }
.btn-sm { padding: 5px 11px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Hero ---------- */
.hero { padding: 96px 0 72px; text-align: center; position: relative; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 14px; border-radius: 100px;
  border: 1px solid var(--border-strong);
  font-size: 13px; color: var(--text-dim);
  margin-bottom: 28px;
}
.hero-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }
.hero h1 {
  font-size: 52px; line-height: 1.1; font-weight: 700; letter-spacing: -0.03em;
  max-width: 760px; margin: 0 auto 20px;
}
.hero h1 .accent { color: var(--accent); }
.hero p.lead {
  font-size: 17px; color: var(--text-dim);
  max-width: 620px; margin: 0 auto 36px;
}
.hero-actions { display: flex; gap: 12px; justify-content: center; }

/* ---------- Stats bar ---------- */
.stats-bar {
  display: flex; justify-content: center; gap: 0;
  margin: 64px auto 0; max-width: 800px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-raised);
}
.stats-bar .stat {
  flex: 1; padding: 20px 16px; text-align: center;
  border-right: 1px solid var(--border);
}
.stats-bar .stat:last-child { border-right: none; }
.stats-bar .stat .value { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stats-bar .stat .label { font-size: 12.5px; color: var(--text-faint); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.06em; }

/* ---------- Sections ---------- */
.section { padding: 88px 0; content-visibility: auto; contain-intrinsic-size: auto 480px; }
.feature-grid { content-visibility: auto; contain-intrinsic-size: auto 600px; }
.preview-split { content-visibility: auto; contain-intrinsic-size: auto 400px; }
.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head .eyebrow {
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 12px;
}
.section-head h2 { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 12px; }
.section-head p { color: var(--text-dim); font-size: 15.5px; }

.divider { border: none; border-top: 1px solid var(--border); }

/* ---------- Feature grid ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.feature-cell { background: var(--bg-raised); padding: 26px 24px; transition: background 0.15s; }
.feature-cell:hover { background: var(--bg-panel); }
.feature-cell .icon {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; margin-bottom: 16px;
}
.feature-cell .icon svg { width: 17px; height: 17px; }
.feature-cell h3 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.feature-cell p { font-size: 13.5px; color: var(--text-dim); line-height: 1.55; }

/* ---------- Product preview panels ---------- */
.preview-split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.preview-split.reverse > .preview-copy { order: 2; }
.preview-copy h3 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 12px; }
.preview-copy p { color: var(--text-dim); margin-bottom: 20px; }
.preview-copy ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.preview-copy ul li { display: flex; gap: 10px; font-size: 14px; color: var(--text-dim); align-items: baseline; }
.preview-copy ul li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); flex-shrink: 0; position: relative; top: -2px; }

.ui-panel {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-raised); overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  font-size: 13px;
}
.ui-panel .ui-titlebar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  color: var(--text-faint); font-size: 12.5px; font-weight: 500;
}
.ui-panel .ui-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.ui-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-panel);
}
.ui-row .ui-row-main { display: flex; flex-direction: column; gap: 1px; }
.ui-row .ui-row-title { font-weight: 500; font-size: 13px; }
.ui-row .ui-row-sub { color: var(--text-faint); font-size: 12px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px; border-radius: 100px; font-size: 11.5px; font-weight: 500;
}
.pill.on { background: rgba(74, 222, 128, 0.1); color: var(--success); }
.pill.off { background: rgba(154, 160, 174, 0.1); color: var(--text-faint); }
.pill.warn { background: rgba(251, 191, 36, 0.1); color: var(--warning); }
.pill.danger { background: rgba(248, 113, 113, 0.1); color: var(--danger); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }

/* Toggle switch (static preview + dashboard) */
.switch { position: relative; width: 34px; height: 19px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0; border-radius: 100px;
  background: var(--border-strong); transition: background 0.15s; cursor: pointer;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 15px; height: 15px; border-radius: 50%; background: #fff;
  transition: transform 0.15s;
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(15px); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 56px 0 40px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-brand p { color: var(--text-faint); font-size: 13.5px; margin-top: 12px; max-width: 280px; }
.footer h4 { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-faint); margin-bottom: 14px; font-weight: 600; }
.footer-col { display: flex; flex-direction: column; gap: 9px; }
.footer-col a { font-size: 13.5px; color: var(--text-dim); transition: color 0.15s; }
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 24px; border-top: 1px solid var(--border);
  font-size: 13px; color: var(--text-faint);
}

/* ---------- Commands page ---------- */
.page-head { padding: 56px 0 32px; }
.page-head h1 { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 8px; }
.page-head p { color: var(--text-dim); }

.search-input {
  width: 100%; padding: 10px 14px;
  background: var(--bg-raised); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); color: var(--text); font-size: 14px;
  font-family: inherit; outline: none; transition: border-color 0.15s;
}
.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--text-faint); }

.cmd-filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 24px; }
.cmd-filter {
  padding: 5px 13px; border-radius: 100px; font-size: 13px;
  border: 1px solid var(--border-strong); color: var(--text-dim);
  background: transparent; cursor: pointer; transition: all 0.15s;
}
.cmd-filter:hover { color: var(--text); }
.cmd-filter.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.cmd-list { display: flex; flex-direction: column; gap: 8px; padding-bottom: 80px; }
.cmd-item {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-raised); padding: 14px 18px;
}
.cmd-item-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cmd-item code.name { font-family: var(--mono); font-size: 14px; color: var(--accent); font-weight: 600; }
.cmd-item .cat { font-size: 11.5px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.05em; }
.cmd-item p { font-size: 13.5px; color: var(--text-dim); margin-top: 6px; }
.cmd-item .usage { font-family: var(--mono); font-size: 12.5px; color: var(--text-faint); margin-top: 6px; }

/* ---------- Docs ---------- */
.docs-layout { display: grid; grid-template-columns: 230px 1fr; gap: 48px; padding: 40px 0 100px; }
.docs-nav { position: sticky; top: 84px; align-self: start; display: flex; flex-direction: column; gap: 2px; }
.docs-nav h5 { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-faint); margin: 18px 0 8px; font-weight: 600; }
.docs-nav h5:first-child { margin-top: 0; }
.docs-nav a { font-size: 13.5px; color: var(--text-dim); padding: 5px 10px; border-radius: var(--radius-sm); border-left: 2px solid transparent; }
.docs-nav a:hover { color: var(--text); background: var(--bg-hover); }
.docs-nav a.active { color: var(--accent); border-left-color: var(--accent); background: var(--accent-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.docs-content h1 { font-size: 30px; letter-spacing: -0.02em; margin-bottom: 16px; }
.docs-content h2 { font-size: 21px; letter-spacing: -0.01em; margin: 40px 0 12px; padding-top: 16px; border-top: 1px solid var(--border); }
.docs-content h3 { font-size: 16px; margin: 24px 0 8px; }
.docs-content p { color: var(--text-dim); margin-bottom: 12px; font-size: 14.5px; }
.docs-content ul, .docs-content ol { color: var(--text-dim); margin: 0 0 14px 22px; font-size: 14.5px; }
.docs-content li { margin-bottom: 5px; }
.docs-content code {
  font-family: var(--mono); font-size: 13px;
  background: var(--bg-panel); border: 1px solid var(--border);
  padding: 1.5px 6px; border-radius: 4px;
}
.docs-content pre {
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px; overflow-x: auto;
  margin-bottom: 16px;
}
.docs-content pre code { background: none; border: none; padding: 0; font-size: 13px; color: var(--text-dim); }
.docs-content table { width: 100%; border-collapse: collapse; margin-bottom: 16px; font-size: 13.5px; }
.docs-content th { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border-strong); color: var(--text-faint); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.04em; }
.docs-content td { padding: 8px 12px; border-bottom: 1px solid var(--border); color: var(--text-dim); }

.callout {
  border: 1px solid var(--border-strong); border-left: 3px solid var(--accent);
  background: var(--bg-raised); border-radius: var(--radius-sm);
  padding: 12px 16px; margin-bottom: 16px; font-size: 14px; color: var(--text-dim);
}

/* ---------- Status page ---------- */
.status-overall {
  display: flex; align-items: center; gap: 14px;
  padding: 22px 24px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-raised); margin-bottom: 24px;
}
.status-overall .indicator { width: 12px; height: 12px; border-radius: 50%; }
.status-overall .indicator.operational { background: var(--success); box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.15); }
.status-overall .indicator.degraded { background: var(--warning); box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.15); }
.status-overall .indicator.major_outage { background: var(--danger); box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.15); }
.status-overall h2 { font-size: 18px; font-weight: 600; }
.status-overall .sub { font-size: 13px; color: var(--text-faint); }

.status-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-raised); overflow: hidden; margin-bottom: 24px; }
.status-item { display: flex; align-items: center; justify-content: space-between; padding: 15px 20px; border-bottom: 1px solid var(--border); }
.status-item:last-child { border-bottom: none; }
.status-item .name { font-size: 14px; font-weight: 500; }
.status-item .detail { font-size: 12.5px; color: var(--text-faint); margin-top: 1px; }

.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 40px; }
.metric-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-raised); padding: 18px 20px; }
.metric-card .label { font-size: 12px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.metric-card .value { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

/* ---------- Server selection ---------- */
.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; padding-bottom: 80px; }
.server-card {
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-raised); padding: 16px 18px;
  transition: border-color 0.15s, background 0.15s;
}
.server-card:hover { border-color: var(--border-strong); background: var(--bg-panel); }
.server-card .server-icon {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
  background: var(--bg-hover); display: grid; place-items: center;
  font-weight: 700; font-size: 17px; color: var(--text-dim);
  overflow: hidden; border: 1px solid var(--border);
}
.server-card .server-icon img { width: 100%; height: 100%; object-fit: cover; }
.server-card .server-info { flex: 1; min-width: 0; }
.server-card .server-name { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.server-card .server-meta { display: flex; gap: 8px; margin-top: 5px; align-items: center; flex-wrap: wrap; }
.server-card .members { font-size: 12px; color: var(--text-faint); }

.empty-state {
  text-align: center; padding: 72px 24px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  margin-bottom: 40px;
}
.empty-state .icon { font-size: 32px; margin-bottom: 14px; opacity: 0.6; }
.empty-state h3 { font-size: 17px; margin-bottom: 8px; }
.empty-state p { color: var(--text-dim); font-size: 14px; max-width: 420px; margin: 0 auto 20px; }

/* ---------- Skeletons ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-panel) 25%, var(--bg-hover) 50%, var(--bg-panel) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---------- Misc ---------- */
.fade-in { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Scroll reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.revealed {
  opacity: 1;
  transform: none;
}
.feature-cell.reveal { transition-delay: calc(var(--i, 0) * 40ms); }
.hero.reveal { transition-duration: 0.7s; }

/* Minimal footer */
.footer-minimal { padding: 28px 0; }
.footer-minimal-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.footer-brand-mark { font-weight: 700; }
.footer-copy { font-size: 13px; color: var(--text-faint); }

/* Shards table */
.shards-toolbar { margin-bottom: 20px; }
.shards-table-wrap {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-raised); overflow: hidden;
}
.shards-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.shards-table th {
  text-align: left; padding: 12px 16px; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-faint); border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
}
.shards-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.shards-table tr:last-child td { border-bottom: none; }
.shards-table tr:hover td { background: var(--bg-hover); }
.shard-server { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.shard-icon { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.shard-icon-fallback { background: var(--accent-soft); display: inline-block; }
.empty-cell { text-align: center; color: var(--text-dim); padding: 32px !important; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .fade-in { animation: none; }
  html { scroll-behavior: auto; }
}

.mono { font-family: var(--mono); }
.text-dim { color: var(--text-dim); }
.text-faint { color: var(--text-faint); }

@media (max-width: 900px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .preview-split { grid-template-columns: 1fr; gap: 32px; }
  .preview-split.reverse > .preview-copy { order: 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .docs-layout { grid-template-columns: 1fr; }
  .docs-nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .hero h1 { font-size: 38px; }
  .nav-links { display: none; }
  .metric-grid { grid-template-columns: 1fr; }
  .stats-bar { flex-wrap: wrap; }
  .stats-bar .stat { min-width: 45%; }
}
