/* XYZnet Project Hub — design tokens from styles.md */

:root {
  --canvas: #0a0a0a;
  --panel: #0d0d0d;
  --card: rgba(24, 24, 27, 0.5);
  --card-solid: #18181b;
  --editor: #09090b;
  --border: rgba(39, 39, 42, 0.5);
  --border-strong: #27272a;
  --emerald: #34d399;
  --emerald-btn: #10b981;
  --blue: #60a5fa;
  --yellow: #facc15;
  --purple: #c084fc;
  --zinc-300: #d4d4d8;
  --zinc-400: #a1a1aa;
  --zinc-500: #71717a;
  --zinc-600: #52525b;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--canvas); color: var(--zinc-300); scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  background: var(--canvas);
  display: flex;
  flex-direction: column;
}
a { color: var(--emerald); text-decoration: none; transition: color .15s; }
a:hover { color: #6ee7b7; }
code, .mono { font-family: var(--mono); font-size: .9em; }

/* nav */
.topnav {
  position: sticky; top: 0; z-index: 50;
  height: 3.5rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0 1.25rem;
  background: rgba(13,13,13,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex; align-items: center; gap: .65rem;
  color: #fff; font-weight: 700; letter-spacing: -.02em; font-size: .95rem;
}
.brand:hover { color: #fff; }
.brand img, .brand svg { width: 28px; height: 28px; border-radius: 8px; }
.brand span.sub { color: var(--zinc-500); font-weight: 500; font-size: .8rem; }
.nav-center { display: flex; gap: .15rem; list-style: none; margin: 0; padding: 0; }
.nav-center a {
  display: block; padding: .4rem .85rem; border-radius: 999px;
  color: var(--zinc-400); font-size: .85rem; font-weight: 500;
}
.nav-center a:hover { color: #fff; background: rgba(16,185,129,.1); }
.nav-center a.active { color: var(--emerald); background: rgba(16,185,129,.12); }
.nav-right { display: flex; align-items: center; gap: .5rem; }
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .4rem .9rem; border-radius: 999px; font-weight: 600; font-size: .82rem;
  border: 1px solid transparent; cursor: pointer; font-family: inherit;
  transition: .15s;
}
.btn-primary { background: var(--emerald-btn); color: #0a0a0a; }
.btn-primary:hover { background: #34d399; color: #0a0a0a; }
.btn-ghost { background: transparent; color: var(--zinc-300); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--zinc-500); color: #fff; }

/* layout */
.main { flex: 1; padding: 1.5rem 1.25rem 3.5rem; max-width: 1200px; width: 100%; margin: 0 auto; }
.page-title { font-size: 1.75rem; font-weight: 700; color: #fff; letter-spacing: -.03em; margin: 0 0 .5rem; }
.page-lead { color: var(--zinc-400); max-width: 60ch; margin: 0 0 1.5rem; font-size: .9rem; line-height: 1.65; }
.eyebrow {
  font-family: var(--mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: .12em; color: var(--zinc-500); margin: 0 0 .5rem;
}

.grid { display: grid; gap: 1.25rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .nav-center { display: none; }
  .hero-span { grid-column: auto !important; }
}
.hero-span { grid-column: span 2; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.15rem 1.25rem;
  backdrop-filter: blur(4px);
}
.card-solid { background: var(--card-solid); }
.card h2, .card h3 {
  margin: 0 0 .75rem; font-size: 1rem; font-weight: 700; color: #fff;
}
.card p { margin: 0 0 .75rem; color: var(--zinc-400); font-size: .875rem; line-height: 1.65; }
.card p:last-child { margin-bottom: 0; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; }
@media (max-width: 700px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat {
  background: rgba(9,9,11,.6);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .9rem 1rem;
}
.stat .n { font-size: 1.6rem; font-weight: 700; color: #fff; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--zinc-500); margin-top: .25rem; font-family: var(--mono); }

/* tables */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 12px;
}
table.data th {
  text-align: left; color: var(--zinc-500); font-weight: 600;
  padding: .5rem .65rem; border-bottom: 1px solid var(--border-strong);
  text-transform: uppercase; letter-spacing: .06em; font-size: 10px;
}
table.data td {
  padding: .5rem .65rem; border-bottom: 1px solid var(--border);
  color: var(--zinc-300); vertical-align: top;
}
table.data tr:hover td { background: rgba(39,39,42,.3); }
table.data td.mode { color: var(--emerald); font-weight: 600; white-space: nowrap; }
table.data td.mode-u { color: var(--blue); font-weight: 600; white-space: nowrap; }
table.data td.mode-s { color: var(--yellow); font-weight: 600; white-space: nowrap; }

.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #18181b 0%, #000 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem 1.5rem;
  min-height: 200px;
}
.hero h1 { font-size: clamp(1.6rem, 3vw, 2.25rem); font-weight: 700; color: #fff; letter-spacing: -.03em; margin: 0 0 .75rem; line-height: 1.2; }
.hero h1 em { font-style: normal; color: var(--emerald); }
.hero p { color: var(--zinc-400); max-width: 48ch; margin: 0 0 1.25rem; font-size: .9rem; line-height: 1.65; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.hero-watermark {
  position: absolute; right: -20px; bottom: -30px; opacity: .04;
  font-size: 10rem; font-family: var(--mono); pointer-events: none; user-select: none;
}

.tree { font-family: var(--mono); font-size: .82rem; color: var(--zinc-400); list-style: none; margin: 0; padding: 0; }
.tree li { padding: .2rem 0; }
.tree .folder { color: var(--blue); }
.tree .file { color: var(--zinc-400); }
.tree ul { list-style: none; margin: 0; padding-left: 1rem; border-left: 1px solid var(--border); }
.dot-live { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--emerald); box-shadow: 0 0 8px var(--emerald); margin-right: .4rem; }

.prose h2 { font-size: 1.15rem; color: #fff; margin: 1.75rem 0 .75rem; font-weight: 700; }
.prose h3 { font-size: .95rem; color: var(--zinc-300); margin: 1.25rem 0 .5rem; font-weight: 650; }
.prose p, .prose li { color: var(--zinc-400); font-size: .9rem; line-height: 1.7; }
.prose ul, .prose ol { padding-left: 1.25rem; margin: .5rem 0 1rem; }
.prose li { margin: .3rem 0; }
.prose strong { color: var(--zinc-300); }
.prose a { color: var(--emerald); }

.link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; }
.link-card {
  display: block; padding: 1rem; border-radius: 10px;
  border: 1px solid var(--border); background: rgba(9,9,11,.5);
  transition: border-color .15s, background .15s;
}
.link-card:hover { border-color: var(--zinc-500); background: rgba(39,39,42,.35); color: inherit; }
.link-card strong { display: block; color: #fff; margin-bottom: .25rem; font-size: .9rem; }
.link-card span { color: var(--zinc-500); font-size: .8rem; line-height: 1.45; display: block; }

.docs-layout { display: grid; grid-template-columns: 220px 1fr; gap: 1.25rem; align-items: start; }
@media (max-width: 800px) { .docs-layout { grid-template-columns: 1fr; } }
.docs-nav {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 1rem; height: fit-content; position: sticky; top: 4.5rem;
}
.docs-nav a {
  display: block; padding: .35rem .5rem; border-radius: 6px;
  color: var(--zinc-400); font-size: .82rem; font-family: var(--mono);
}
.docs-nav a:hover, .docs-nav a.active { color: var(--emerald); background: rgba(16,185,129,.08); }
.docs-nav .group { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--zinc-500); margin: .75rem 0 .35rem; font-family: var(--mono); }
.docs-nav .group:first-child { margin-top: 0; }

.docs-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 900px) { .docs-pick { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .docs-pick { grid-template-columns: 1fr; } }
.docs-pick-card {
  display: block; padding: 1.15rem 1.25rem; border-radius: 12px;
  border: 1px solid var(--border); background: linear-gradient(145deg, rgba(24,24,27,.7), rgba(0,0,0,.5));
  transition: border-color .15s, transform .15s;
}
.docs-pick-card:hover { border-color: rgba(52,211,153,.45); color: inherit; transform: translateY(-1px); }
.docs-pick-card strong { display: block; color: #fff; font-size: 1.05rem; margin: .15rem 0 .4rem; }
.docs-pick-card span:last-child { color: var(--zinc-500); font-size: .85rem; line-height: 1.5; display: block; }

.docs-wiki { scroll-margin-top: 5rem; }
.docs-wiki-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  margin-bottom: 1rem; flex-wrap: wrap;
}
.docs-h4 {
  font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: .08em; color: var(--zinc-500); margin: 1.1rem 0 .5rem; font-weight: 600;
}
.pill {
  display: inline-flex; align-items: center; padding: .25rem .65rem; border-radius: 999px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .04em; border: 1px solid var(--border);
  color: var(--zinc-400); white-space: nowrap;
}
.pill-emerald { color: var(--emerald); border-color: rgba(16,185,129,.35); background: rgba(16,185,129,.08); }
.pill-purple { color: var(--purple); border-color: rgba(192,132,252,.35); background: rgba(192,132,252,.08); }
.note-line {
  font-size: .8rem; color: var(--zinc-500); margin: .65rem 0 0;
  padding: .55rem .75rem; border-left: 2px solid var(--border-strong);
  background: rgba(9,9,11,.4); border-radius: 0 8px 8px 0;
}
table.data td.cmd { color: var(--emerald); font-weight: 500; font-family: var(--mono); font-size: 11px; white-space: nowrap; }
.code-block {
  font-family: var(--mono); font-size: 12px; line-height: 1.65;
  background: var(--editor); border: 1px solid var(--border); border-radius: 10px;
  padding: 1rem 1.1rem; color: var(--zinc-300); overflow-x: auto; margin: .75rem 0 1rem;
}
.docs-body h3 { scroll-margin-top: 5rem; }
.prose h4 { margin: 0; }

/* footer status bar */
.status-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  height: 2rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0 1rem;
  background: var(--panel);
  border-top: 1px solid var(--border);
  font-family: var(--mono); font-size: 10px; color: var(--zinc-500);
}
.status-bar .live { color: var(--emerald); }
.status-bar .sep { opacity: .4; margin: 0 .35rem; }

.mobile-menu-btn {
  display: none; background: none; border: 1px solid var(--border-strong);
  color: var(--zinc-300); border-radius: 8px; padding: .35rem .55rem; cursor: pointer;
}
@media (max-width: 900px) {
  .mobile-menu-btn { display: inline-flex; }
  .nav-center.open {
    display: flex; flex-direction: column; position: absolute; top: 3.5rem; left: 0; right: 0;
    background: var(--panel); border-bottom: 1px solid var(--border); padding: .5rem;
  }
}

/* Chat CTA in nav */
.nav-center a.nav-chat { color: var(--emerald); }
.nav-center a.nav-chat:hover { color: #6ee7b7; background: rgba(16,185,129,.12); }
