/* ==========================================================================
   XYZnet v3 — "old school meets sleek"
   Modern dark base (navy/charcoal, mint + indigo accents), monospace accents.
   No external fonts/CDNs (CSP: self only). Respects prefers-reduced-motion.
   ========================================================================== */

:root {
  --bg: #0a0f1c;
  --bg-2: #0d1424;
  --surface: rgba(19, 27, 46, .72);
  --surface-solid: #131b2e;
  --surface-2: #18223a;
  --border: rgba(148, 163, 184, .14);
  --border-strong: rgba(148, 163, 184, .26);
  --text: #e6eaf2;
  --text-2: #c3cad8;
  --muted: #94a0b8;          /* 7.0:1 on --bg */
  --accent: #3ee6b0;         /* mint  — 11:1 on --bg */
  --accent-ink: #052a1f;
  --accent-2: #8b9cff;       /* indigo — 7.4:1 on --bg */
  --warn: #fbbf24;
  --danger: #f87171;
  --ok: #34d399;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 10px 30px -12px rgba(0,0,0,.6);
  --shadow-lg: 0 30px 80px -30px rgba(0,0,0,.8), 0 0 0 1px var(--border);
  --container: 1200px;
  --nav-h: 64px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, "DejaVu Sans Mono", "Liberation Mono", monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  /* legacy tokens used by inline styles in older pages */
  --zinc-300: var(--text-2);
  --zinc-500: var(--muted);
  --zinc-600: var(--muted);
  --blue: var(--accent-2);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  margin: 0;
  min-height: 100vh;
  display: flex; flex-direction: column;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(139,156,255,.10), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(62,230,176,.07), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 400 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; text-underline-offset: .2em; transition: color .15s var(--ease); }
a:hover { color: #7ff1cc; text-decoration: underline; }
p { margin: 0 0 1rem; overflow-wrap: break-word; }
.prose p, .prose li, .note-line, .card li { overflow-wrap: anywhere; }
ul, ol { padding-left: 1.25rem; }
li { margin: .25rem 0; }
strong { color: #fff; font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }

h1, h2, h3, h4 {
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.2;
  color: #f4f6fb;
  margin: 0 0 .75rem;
}
h1 { font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3rem); }
h2 { font-size: clamp(1.25rem, 1.05rem + .8vw, 1.6rem); }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }

code, kbd, samp, pre, .mono { font-family: var(--mono); }
code {
  font-size: .86em;
  color: #c9f7e7;
  background: rgba(62,230,176,.08);
  border: 1px solid rgba(62,230,176,.16);
  border-radius: 6px;
  padding: .08em .4em;
  overflow-wrap: anywhere;
}
pre { margin: 0; overflow-x: auto; font-size: .88rem; line-height: 1.55; }
pre code { background: none; border: 0; padding: 0; }
.small { font-size: .85rem; }
.muted { color: var(--muted); }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* focus */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
  box-shadow: 0 0 0 6px rgba(62,230,176,.18);
}
#main:focus-visible { box-shadow: none; outline: none; }

.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 100;
  background: var(--accent); color: var(--accent-ink); font-weight: 700;
  padding: .6rem 1rem; border-radius: 10px; transition: top .2s var(--ease);
}
.skip-link:focus { top: .75rem; text-decoration: none; color: var(--accent-ink); }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 clamp(1rem, 3vw, 2rem); }
.site-main { flex: 1 0 auto; }
.page-body { padding-top: clamp(2rem, 5vw, 3.5rem); padding-bottom: 4rem; }

/* ---------- top nav (sticky, translucent) ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 15, 28, .72);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-wrap { display: flex; align-items: center; gap: 1.5rem; min-height: var(--nav-h); }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--text); font-family: var(--mono); font-weight: 700; }
.brand:hover { text-decoration: none; color: #fff; }
.brand-mark {
  display: inline-grid; place-items: center;
  width: 2rem; height: 2rem; border-radius: 9px;
  font-size: .8rem; color: var(--accent);
  background: linear-gradient(145deg, rgba(62,230,176,.18), rgba(139,156,255,.14));
  border: 1px solid rgba(62,230,176,.32);
  box-shadow: 0 0 18px -4px rgba(62,230,176,.45);
}
.brand-name { font-size: 1.1rem; letter-spacing: -.01em; }
.brand-name span { color: var(--accent-2); }

.site-nav { display: flex; align-items: center; gap: 1rem; flex: 1; justify-content: space-between; }
.nav-links { display: flex; align-items: center; gap: .15rem; list-style: none; margin: 0; padding: 0; }
.nav-links li { margin: 0; }
.nav-links a, .nav-more summary {
  display: block; padding: .45rem .75rem; border-radius: 8px;
  color: var(--text-2); font-size: .93rem; font-weight: 500;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.nav-links a:hover, .nav-more summary:hover { background: rgba(148,163,184,.10); color: #fff; text-decoration: none; }
.nav-links a[aria-current="page"], .nav-more summary.is-active { color: var(--accent); background: rgba(62,230,176,.09); }
.nav-more { position: relative; }
.nav-more summary { cursor: pointer; list-style: none; user-select: none; }
.nav-more summary::-webkit-details-marker { display: none; }
.nav-more summary::after { content: "▾"; font-size: .75em; margin-left: .35em; opacity: .7; }
.nav-more .menu {
  position: absolute; right: 0; top: calc(100% + .5rem); min-width: 15rem;
  background: rgba(19, 27, 46, .97); border: 1px solid var(--border-strong);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: .5rem;
  animation: pop .16s var(--ease);
}
.menu ul { list-style: none; margin: 0 0 .25rem; padding: 0; }
.menu a { padding: .4rem .65rem; }
.menu-h { margin: .4rem .65rem .2rem; font: 600 .7rem/1 var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.ext { font-size: .8em; opacity: .7; }
.nav-actions { display: flex; gap: .5rem; align-items: center; }

.nav-toggle {
  margin-left: auto; display: none; width: 42px; height: 42px; border-radius: 10px;
  background: transparent; border: 1px solid var(--border-strong); color: var(--text); cursor: pointer;
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
  display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; margin: 0 auto;
  position: relative; transition: transform .2s var(--ease), opacity .2s;
}
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 960px) {
  .nav-wrap { flex-wrap: wrap; gap: .5rem; }
  .js .nav-toggle { display: inline-grid; place-items: center; }
  .site-nav { flex-basis: 100%; flex-direction: column; align-items: stretch; gap: .75rem; padding: .25rem 0 1rem; }
  .js .site-nav { display: none; }
  .js .site-nav.open { display: flex; animation: pop .18s var(--ease); }
  .nav-links { flex-direction: column; align-items: stretch; }
  .nav-links a, .nav-more summary { padding: .7rem .75rem; font-size: 1rem; }
  .nav-more .menu { position: static; box-shadow: none; background: transparent; border: 0; padding: 0 0 0 .75rem; animation: none; }
  .nav-more details { display: contents; }
  .nav-more summary { display: none; }
  .nav-actions .btn { flex: 1; justify-content: center; }
}
/* no-JS small screens: links simply wrap */
@media (max-width: 960px) { html:not(.js) .nav-more summary { display: block; } html:not(.js) .nav-more details { display: block; } }

/* ---------- buttons, pills, chips ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .6rem 1.05rem; border-radius: 10px; border: 1px solid var(--border-strong);
  background: rgba(148,163,184,.06); color: var(--text);
  font: 600 .93rem/1.2 var(--sans); cursor: pointer; text-decoration: none;
  transition: transform .15s var(--ease), background .15s var(--ease), border-color .15s var(--ease), box-shadow .2s var(--ease);
}
.btn:hover { text-decoration: none; color: #fff; background: rgba(148,163,184,.12); border-color: rgba(148,163,184,.4); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(135deg, #3ee6b0, #2fc9e6); color: var(--accent-ink); border-color: transparent;
  box-shadow: 0 8px 24px -10px rgba(62,230,176,.7);
}
.btn-primary:hover { color: var(--accent-ink); background: linear-gradient(135deg, #5af0c0, #4ad6ee); box-shadow: 0 10px 30px -8px rgba(62,230,176,.8); }
.btn-primary .mono { opacity: .75; font-size: .85em; }
.btn-ghost { background: transparent; }
.btn-sm { padding: .42rem .8rem; font-size: .86rem; border-radius: 9px; }
.btn-lg { padding: .8rem 1.35rem; font-size: 1rem; border-radius: 12px; }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; }

.pill, .tag, .badge {
  display: inline-flex; align-items: center; gap: .3rem;
  font: 600 .72rem/1 var(--mono); letter-spacing: .03em;
  padding: .32rem .55rem; border-radius: 999px;
  border: 1px solid var(--border-strong); color: var(--text-2); background: rgba(148,163,184,.08);
  vertical-align: middle;
}
.pill-emerald, .badge-ok { color: #8af5d0; border-color: rgba(62,230,176,.35); background: rgba(62,230,176,.10); }
.pill-purple { color: #c4cbff; border-color: rgba(139,156,255,.38); background: rgba(139,156,255,.12); }
.badge-down { color: #fecaca; border-color: rgba(248,113,113,.45); background: rgba(248,113,113,.12); }
.tag { color: var(--accent-2); border-color: rgba(139,156,255,.3); background: rgba(139,156,255,.08); }

.chips { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .55rem; }
.chips li { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .75rem; margin: 0; }
.chips .desc { color: var(--muted); font-size: .88rem; }
.chip {
  display: inline-flex; align-items: stretch; max-width: 100%;
  font: 500 .9rem/1.2 var(--mono);
  background: rgba(10, 15, 28, .6); border: 1px solid var(--border-strong); border-radius: 10px;
  overflow: hidden; transition: border-color .15s var(--ease), box-shadow .2s var(--ease);
}
.chip:hover, .chip:focus-within { border-color: rgba(62,230,176,.5); box-shadow: 0 0 0 3px rgba(62,230,176,.12); }
.chip > a, .chip > code {
  padding: .48rem .75rem; color: #d9fbef; background: none; border: 0; border-radius: 0; font-size: inherit;
  overflow-wrap: anywhere;
}
.chip > a::before, .chip > code::before { content: "› "; color: var(--accent); }
.chip > a:hover { text-decoration: none; color: #fff; }
.copy {
  display: inline-flex; align-items: center; gap: .3rem;
  border: 0; border-left: 1px solid var(--border); background: rgba(148,163,184,.06);
  color: var(--muted); font: 600 .72rem/1 var(--mono); padding: 0 .65rem; cursor: pointer;
  transition: background .15s, color .15s;
}
.copy:hover { background: rgba(62,230,176,.12); color: var(--accent); }
.copy.copied { color: var(--accent); }
.copy:focus-visible { outline-offset: -2px; border-radius: 0 10px 10px 0; box-shadow: none; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--border); }
.hero-bg {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(700px 380px at 75% 30%, rgba(139,156,255,.20), transparent 65%),
    radial-gradient(600px 360px at 20% 10%, rgba(62,230,176,.14), transparent 65%),
    linear-gradient(180deg, rgba(13,20,36,.0), rgba(13,20,36,.8));
}
.hero-bg::after { /* faint grid */
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(148,163,184,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(148,163,184,.05) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 75%);
}
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(2rem, 4vw, 4rem);
  align-items: center; padding-top: clamp(3rem, 7vw, 6rem); padding-bottom: clamp(2.5rem, 6vw, 4.5rem);
}
.hero h1 { font-size: clamp(2.1rem, 1.2rem + 3.4vw, 3.6rem); letter-spacing: -.035em; margin-bottom: 1rem; }
.grad { background: linear-gradient(100deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead { font-size: clamp(1.02rem, .95rem + .35vw, 1.2rem); color: var(--text-2); max-width: 36rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

/* CRT panel — the one place with scanlines + glow */
.crt {
  position: relative; border-radius: 16px; overflow: hidden;
  background: #050a12; border: 1px solid rgba(62,230,176,.22);
  box-shadow: 0 0 0 1px rgba(0,0,0,.4), 0 30px 80px -30px rgba(0,0,0,.9), 0 0 60px -20px rgba(62,230,176,.35);
}
.crt-bar {
  display: flex; align-items: center; gap: .4rem; padding: .6rem .85rem;
  background: rgba(148,163,184,.06); border-bottom: 1px solid rgba(148,163,184,.12);
  font: 500 .75rem/1 var(--mono); color: var(--muted);
}
.crt-bar span { width: 10px; height: 10px; border-radius: 50%; background: #3a4458; }
.crt-bar span:nth-child(1) { background: #f87171; } .crt-bar span:nth-child(2) { background: #fbbf24; } .crt-bar span:nth-child(3) { background: #34d399; }
.crt-bar em { font-style: normal; margin-left: .5rem; }
.crt-screen { position: relative; padding: 1.4rem 1.4rem 1.2rem; color: #b8ffe5; font-family: var(--mono); }
.crt-screen::before { /* scanlines */
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: repeating-linear-gradient(180deg, rgba(0,0,0,0) 0 2px, rgba(0,0,0,.28) 2px 3px);
  mix-blend-mode: multiply;
}
.crt-screen::after { /* vignette + phosphor glow */
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(ellipse at 50% 40%, rgba(62,230,176,.10), transparent 60%), radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.55) 100%);
  animation: flicker 6s steps(60) infinite;
}
.banner {
  margin: 0 0 1rem; font-size: clamp(6.5px, .85vw, 11.5px); line-height: 1.12; overflow: hidden;
  text-shadow: 0 0 6px rgba(62,230,176,.55), 0 0 18px rgba(62,230,176,.25);
}
.banner .c-xyz { color: #5ff2c2; }
.banner .c-net { color: #a4b1ff; text-shadow: 0 0 6px rgba(139,156,255,.6), 0 0 18px rgba(139,156,255,.25); }
.banner-narrow { display: none; }
.crt-line { margin: 0 0 1rem; font-size: .8rem; color: #7fd8b7; text-shadow: 0 0 6px rgba(62,230,176,.35); }
.crt-line:last-child { margin: 1rem 0 0; }
.crt-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; margin: 0; position: relative; z-index: 3; }
.crt-stats div { border: 1px solid rgba(62,230,176,.2); border-radius: 10px; padding: .6rem .7rem; background: rgba(62,230,176,.04); }
.crt-stats dt { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: #6fbfa3; }
.crt-stats dd { margin: .15rem 0 0; font-size: 1.6rem; font-weight: 700; color: #e6fff6; text-shadow: 0 0 10px rgba(62,230,176,.6); }
.cursor { display: inline-block; width: .55em; height: 1em; margin-left: .25em; vertical-align: -.12em; background: currentColor; animation: blink 1.1s steps(1) infinite; }

/* live ticker / status line */
.ticker { border-top: 1px solid var(--border); background: rgba(5, 10, 18, .55); }
.ticker-inner { display: flex; align-items: center; gap: .85rem; min-height: 44px; font-size: .82rem; color: var(--text-2); }
.ticker-tag { color: var(--accent-ink); background: var(--accent); font-weight: 700; border-radius: 6px; padding: .15rem .45rem; flex: none; }
.ticker-text { margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticker-link { flex: none; color: var(--muted); }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #64748b; vertical-align: .05em; margin-right: .2rem; }
.live-dot.is-live { background: var(--ok); box-shadow: 0 0 0 0 rgba(52,211,153,.6); animation: pulse 2.4s var(--ease) infinite; }

/* ---------- sections, cards ---------- */
.section { margin: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section:first-child { margin-top: 0; }
.section-head { margin-bottom: 1.5rem; max-width: 44rem; }
.section-head h2 { margin-bottom: .4rem; }
.section-head .muted { margin: 0; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .4rem;
  font: 600 .74rem/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 .6rem;
}
.eyebrow::before { content: "//"; color: var(--accent-2); opacity: .8; letter-spacing: 0; }
.hero .eyebrow::before { content: none; }
.page-title { margin-bottom: .75rem; }
.eyebrow + .page-title { margin-top: 0; }
.page-lead { color: var(--text-2); font-size: 1.08rem; max-width: 48rem; margin-bottom: 2rem; }
.page-body > .eyebrow:first-child { margin-top: 0; }

.card {
  position: relative;
  background: linear-gradient(180deg, rgba(24,34,58,.72), rgba(17,25,43,.72));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: clamp(1.15rem, 2.2vw, 1.6rem);
  box-shadow: var(--shadow);
  transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .25s var(--ease);
  margin-bottom: 1.25rem;
  min-width: 0;
}
.grid > .card, .grid > section.card { margin-bottom: 0; }
.card > :last-child { margin-bottom: 0; }
.card h2 { font-size: 1.25rem; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.card-head > * { margin-bottom: 0; }
.card-head h2 { margin: 0; }
.card-title { font: 600 .95rem/1.3 var(--mono); color: var(--text); margin: 0 0 .75rem; }
.card-accent { border-color: rgba(62,230,176,.22); background: linear-gradient(180deg, rgba(62,230,176,.07), rgba(17,25,43,.75) 55%); }
.card-flush { padding: 0; overflow: hidden; }
.card-flush .table-wrap { margin: 0; border: 0; border-radius: 0; }
.card-pad { padding: 1.1rem 1.4rem .5rem; }
.table-foot { margin: 0; padding: .8rem 1.4rem; border-top: 1px solid var(--border); font-size: .85rem; }

.grid { display: grid; gap: 1.25rem; margin-bottom: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2, .hero-span { grid-column: span 2; }

.feature:hover, .link-card:hover, .docs-pick-card:hover, .kv:hover { border-color: rgba(62,230,176,.3); transform: translateY(-2px); box-shadow: 0 20px 40px -20px rgba(0,0,0,.7), 0 0 0 1px rgba(62,230,176,.08); }
.feature-icon {
  display: inline-grid; place-items: center; min-width: 3rem; height: 2.4rem; padding: 0 .6rem; margin-bottom: 1rem;
  border-radius: 10px; font-size: .8rem; font-weight: 700; color: var(--accent);
  background: rgba(62,230,176,.08); border: 1px solid rgba(62,230,176,.22);
}
.feature h3 { font-size: 1.15rem; }
.arrow { font-weight: 600; }
.arrow::after { content: " →"; transition: margin .15s var(--ease); }
.arrow:hover::after { margin-left: .2rem; }
.svc-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.svc-list li { display: flex; gap: .7rem; align-items: baseline; margin: 0 0 .6rem; color: var(--text-2); font-size: .95rem; }
.svc {
  flex: none; display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 7px;
  font: 700 .85rem/1 var(--mono); color: var(--accent-ink); background: var(--accent);
}
.svc-list li:nth-child(2) .svc { background: var(--accent-2); color: #0c1033; }
.svc-list li:nth-child(3) .svc { background: #f0abfc; color: #3b0a3f; }

.kv { padding: 1rem 1.1rem; }
.server-grid { grid-template-columns: 1fr 1fr .8fr 1.35fr; }
.kv-k { font: 600 .7rem/1 var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 0 0 .6rem; }
.kv-v { margin: 0; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }

/* stats */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; margin: 1rem 0 1.25rem; }
.stat { border: 1px solid var(--border); border-radius: 12px; padding: .85rem 1rem; background: rgba(10,15,28,.45); }
.stat .n { font: 700 1.9rem/1.1 var(--mono); color: #fff; letter-spacing: -.02em; }
.stat .l { font: 600 .7rem/1.2 var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-top: .25rem; }

/* news */
.news-feed { list-style: none; padding: 0; margin: 0; }
.news-feed .news-item { padding: 1rem 0; border-top: 1px solid var(--border); margin: 0; }
.news-feed .news-item:first-child { border-top: 0; padding-top: 0; }
.news-page .news-item.card { padding: 1.2rem 1.4rem; border-top: 1px solid var(--border); margin-bottom: 1rem; }
.news-page .news-item.card:first-child { padding-top: 1.2rem; border-top: 1px solid var(--border); }
.news-meta { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; font-size: .8rem; color: var(--muted); margin: 0 0 .45rem; }
.news-who { color: var(--accent-2); font-weight: 600; }
.news-body { color: var(--text); overflow-wrap: anywhere; }
.empty { color: var(--muted); border: 1px dashed var(--border-strong); border-radius: 12px; padding: 1rem 1.2rem; }

/* tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: 12px; margin: 0 0 1rem; background: rgba(10,15,28,.35); }
table { border-collapse: collapse; width: 100%; }
table.data, .irpg-table, .prose table { width: 100%; font-size: .92rem; }
table.data th, table.data td, .irpg-table th, .irpg-table td, .prose table th, .prose table td {
  text-align: left; padding: .6rem .9rem; border-bottom: 1px solid var(--border); vertical-align: top;
}
table.data thead th, .irpg-table thead th, .prose table thead th {
  font: 600 .7rem/1.2 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted);
  background: rgba(148,163,184,.05); border-bottom: 1px solid var(--border-strong); white-space: nowrap;
}
table.data tbody tr:last-child td, .irpg-table tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr, .irpg-table tbody tr { transition: background .12s; }
table.data tbody tr:hover, .irpg-table tbody tr:hover { background: rgba(148,163,184,.05); }
td.mode, td.mode-u, td.mode-s { font: 700 .88rem/1.4 var(--mono); white-space: nowrap; }
td.mode { white-space: normal; min-width: 4.5rem; }
td.mode { color: var(--accent); }
td.mode-u { color: var(--accent-2); }
td.mode-s { color: #f0abfc; }
td.num { text-align: right; }
.c-chan { color: var(--accent); font-weight: 600; white-space: nowrap; }
.list-table td:nth-child(3) { color: var(--text-2); overflow-wrap: anywhere; }

/* prose / docs */
.prose { max-width: none; }
.prose h2 { margin-top: 2rem; padding-top: .25rem; }
.prose h3 { margin-top: 1.75rem; color: #dfe5ff; }
.prose h2:first-child, .prose h3:first-child { margin-top: 0; }
.prose p, .prose li { color: var(--text-2); }
.prose > p, .prose > ul, .prose > ol, .docs-wiki > p, .docs-wiki > ul { max-width: 80ch; }
.prose li strong, .prose p strong { color: #fff; }
.prose table { margin: .75rem 0; }
.docs-h4 { font-size: .9rem; color: var(--accent-2); margin: 1.25rem 0 .5rem; text-transform: uppercase; letter-spacing: .08em; }
.note-line {
  font-size: .9rem; color: var(--text-2); padding: .75rem 1rem; margin: 1rem 0;
  border-left: 3px solid var(--accent-2); background: rgba(139,156,255,.07); border-radius: 0 10px 10px 0;
}
.code-block, .cmd-box, .quickjoin {
  font: .86rem/1.65 var(--mono); color: #c9f7e7; background: #070c16;
  border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.1rem; overflow-x: auto; margin: 0 0 1rem;
}
.cmd-list { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .45rem; }
.cmd-list li { margin: 0; }
.cmd-list a { font-family: var(--mono); }
.cmd-list .desc { color: var(--muted); }

.docs-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.docs-pick-card, .link-card {
  display: flex; flex-direction: column; gap: .35rem;
  background: linear-gradient(180deg, rgba(24,34,58,.72), rgba(17,25,43,.72));
  border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; color: var(--text-2);
  transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .25s var(--ease);
}
.docs-pick-card:hover, .link-card:hover { text-decoration: none; color: var(--text-2); }
.docs-pick-card strong, .link-card strong { font-family: var(--mono); color: #fff; font-size: 1.02rem; }
.docs-pick-card span:not(.eyebrow), .link-card span { font-size: .9rem; color: var(--muted); }
.docs-pick-card .eyebrow { margin: 0; }
.link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .9rem; margin-top: 1rem; }
.link-card { padding: 1rem 1.1rem; background: rgba(10,15,28,.45); }

.docs-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 2rem; align-items: start; }
.docs-nav {
  position: sticky; top: calc(var(--nav-h) + 1rem); max-height: calc(100vh - var(--nav-h) - 2rem); overflow: auto;
  display: flex; flex-direction: column; gap: .1rem; padding: 1rem; font-size: .88rem;
  background: rgba(17,25,43,.6); border: 1px solid var(--border); border-radius: var(--radius);
}
.docs-nav .group { font: 600 .68rem/1 var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--accent-2); margin: .9rem .5rem .35rem; }
.docs-nav .group:first-child { margin-top: .25rem; }
.docs-nav a { color: var(--text-2); padding: .3rem .5rem; border-radius: 7px; }
.docs-nav a:hover { background: rgba(148,163,184,.08); color: #fff; text-decoration: none; }
.docs-body { min-width: 0; }
.docs-wiki { margin-bottom: 1.5rem; }
.docs-wiki-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding-bottom: 1rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.docs-wiki-head .eyebrow { margin-bottom: .3rem; }

/* ascii tree */
.ascii-tree, .tree { font: .86rem/1.6 var(--mono); color: var(--text-2); background: #070c16; border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.2rem; margin: 0; overflow-x: auto; }
.ascii-tree .dir, .tree .dir, .folder { color: var(--accent); font-weight: 700; }
.ascii-tree .note, .tree .note { color: var(--muted); }
.file { color: var(--text-2); }

/* MOTD terminal blocks (mIRC colours rendered) */
.term {
  font: .86rem/1.55 var(--mono); color: #d4dbe8; background: #060a13;
  border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.1rem; overflow-x: auto;
}
.term pre { font-size: inherit; line-height: inherit; }
.term p { margin: 0 0 .35rem; }
.motd-head, .motd-end { color: var(--accent-2); }
.motd-end { margin: .35rem 0 0 !important; }
.srv { color: #556074; }
.motd-card .card-head { align-items: baseline; flex-wrap: wrap; }

/* status */
.status-table td { vertical-align: middle; }
.badge { font-size: .72rem; }

/* forms */
input, select, textarea {
  font: inherit; font-size: .95rem; color: var(--text);
  background: rgba(7,12,22,.75); border: 1px solid var(--border-strong); border-radius: 10px;
  padding: .6rem .8rem; transition: border-color .15s, box-shadow .15s; max-width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(62,230,176,.18); }
::placeholder { color: #66728a; }
label { color: var(--text-2); font-size: .92rem; }
.irc-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.25rem; }
.irc-form label { display: grid; gap: .4rem; font-weight: 500; }
.irc-form label span { font: 600 .72rem/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.irc-form label:nth-last-of-type(1), .irc-form > div { grid-column: 1 / -1; }
.irc-form input, .irc-form textarea { width: 100%; }
.form-card { max-width: 52rem; }
.ok, .err { padding: .8rem 1rem; border-radius: 10px; margin: 0 0 1.25rem; font-weight: 500; }
.ok { color: #b9f8e1; background: rgba(62,230,176,.1); border: 1px solid rgba(62,230,176,.35); }
.err { color: #fecaca; background: rgba(248,113,113,.1); border: 1px solid rgba(248,113,113,.4); }

/* admin / opers standalone pages */
.main { padding: 0 1rem; }
.main .page-title { font-size: 1.8rem; margin-top: 1rem; }
.main form label { display: grid; gap: .35rem; }
.main table { font-size: .9rem; }
.main td, .main th { padding: .45rem .6rem; border-bottom: 1px solid var(--border); text-align: left; }

/* ---------- IdleRPG ---------- */
.irpg-legend { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; font: .82rem/1.4 var(--mono); color: var(--text-2); }
.irpg-map {
  position: relative; width: 100%; aspect-ratio: 1 / 1; max-width: 640px; margin: 1rem auto;
  border-radius: 14px; border: 1px solid var(--border-strong); overflow: hidden;
  background:
    linear-gradient(rgba(148,163,184,.07) 1px, transparent 1px) 0 0 / 10% 10%,
    linear-gradient(90deg, rgba(148,163,184,.07) 1px, transparent 1px) 0 0 / 10% 10%,
    radial-gradient(circle at 40% 35%, rgba(62,230,176,.10), transparent 60%),
    #070c16;
}
.irpg-dot {
  position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%;
  background: #84f5cf; box-shadow: 0 0 0 3px rgba(62,230,176,.18), 0 0 12px rgba(62,230,176,.6);
}
.irpg-dot.good { background: #93a4ff; box-shadow: 0 0 0 3px rgba(139,156,255,.2), 0 0 12px rgba(139,156,255,.6); }
.irpg-dot.evil { background: #f87171; box-shadow: 0 0 0 3px rgba(248,113,113,.2), 0 0 12px rgba(248,113,113,.6); }
.irpg-dot.offline { background: #4b5568; box-shadow: none; }
.irpg-dot.quest { outline: 2px solid var(--warn); outline-offset: 3px; }
.irpg-label { position: absolute; left: 14px; top: -5px; white-space: nowrap; font: 600 .7rem/1 var(--mono); color: var(--text); text-shadow: 0 1px 3px #000; }
.irpg-quest-pt { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border: 2px solid var(--warn); border-radius: 4px; }
.irpg-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.irpg-grid > div > .card:last-child, .irpg-grid > .card { margin-bottom: 0; }
.online-dot { color: var(--ok); }

/* ---------- 404 ---------- */
.nf { max-width: 52rem; margin: 0 auto; text-align: left; }
.nf-code {
  font-size: clamp(4.5rem, 3rem + 8vw, 8rem); font-weight: 800; line-height: 1; letter-spacing: -.05em; margin-bottom: .5rem;
  background: linear-gradient(100deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 24px rgba(62,230,176,.25));
}
.nf-term { margin: 0 0 1.5rem; }
.nf-links { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: .6rem; }
.nf-links li { margin: 0; }
.nf-links a {
  display: flex; align-items: baseline; gap: .6rem; padding: .7rem .9rem; border-radius: 11px;
  border: 1px solid var(--border); background: rgba(17,25,43,.6); color: var(--text);
  transition: border-color .15s, transform .15s var(--ease);
}
.nf-links a:hover { text-decoration: none; border-color: rgba(62,230,176,.35); transform: translateY(-1px); }
.nf-n { color: var(--accent); font-size: .78rem; }
.nf-l { font-weight: 600; flex: 1; }

/* ---------- footer + status line ---------- */
.site-footer { border-top: 1px solid var(--border); background: rgba(7,11,20,.7); margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; padding-top: 3rem; padding-bottom: 2.5rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 1.5rem; }
.footer-grid nav:last-child ul { columns: 1; }
.footer-grid li { margin: 0 0 .45rem; break-inside: avoid; }
.footer-grid a:not(.brand) { color: var(--text-2); font-size: .92rem; }
.footer-grid a:not(.brand):hover { color: #fff; }
.footer-h { font: 600 .72rem/1 var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin: .5rem 0 1rem; }
.footer-brand p { margin: .9rem 0 0; }
.statusline { border-top: 1px solid var(--border); background: #060a13; }
.statusline-inner { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; min-height: 42px; padding-top: .55rem; padding-bottom: .55rem; font-size: .78rem; color: var(--muted); }
.statusline strong { color: var(--text); font-weight: 700; }
.statusline .sep { opacity: .5; }
.statusline-right { margin-left: auto; }
.statusline-right a { color: var(--muted); }
[data-live] { color: var(--text-2); }

/* toast for copy */
.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 1rem); opacity: 0; pointer-events: none; z-index: 90;
  background: var(--surface-2); color: var(--text); border: 1px solid rgba(62,230,176,.4); border-radius: 10px;
  padding: .55rem .9rem; font: 600 .85rem/1.2 var(--mono); box-shadow: var(--shadow-lg);
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- mIRC colours (tuned for dark backgrounds) ---------- */
.mf0 { color: #ffffff; } .mf1 { color: #8a94a6; } .mf2 { color: #6b8cff; } .mf3 { color: #3fcf6e; }
.mf4 { color: #ff5c5c; } .mf5 { color: #c4723f; } .mf6 { color: #c26bd6; } .mf7 { color: #ffa94d; }
.mf8 { color: #ffe066; } .mf9 { color: #7cf08a; } .mf10 { color: #2ec4c4; } .mf11 { color: #66f2ff; }
.mf12 { color: #7c9bff; } .mf13 { color: #ff7ce0; } .mf14 { color: #9aa3b2; } .mf15 { color: #cfd6e2; }
.mb0 { background: #ffffff; } .mb1 { background: #000000; } .mb2 { background: #00007f; } .mb3 { background: #009300; }
.mb4 { background: #c00000; } .mb5 { background: #7f0000; } .mb6 { background: #9c009c; } .mb7 { background: #fc7f00; }
.mb8 { background: #c9b400; } .mb9 { background: #00a800; } .mb10 { background: #008a8a; } .mb11 { background: #00b8c9; }
.mb12 { background: #0000fc; } .mb13 { background: #c900c9; } .mb14 { background: #4b5563; } .mb15 { background: #9ca3af; }
.mB { font-weight: 700; } .mI { font-style: italic; } .mU { text-decoration: underline; } .mS { text-decoration: line-through; }

/* legacy helper colours */
.c-green { color: var(--ok); } .c-lgreen { color: #7cf08a; } .c-red { color: var(--danger); } .c-blue { color: var(--accent-2); }
.c-grey { color: #7c869a; } .c-yellow { color: var(--warn); } .c-white { color: #fff; } .c-pink { color: #f0abfc; }
.c-purple { color: #c4b5fd; } .c-teal { color: #5eead4; } .c-xyz { color: var(--accent); } .c-net { color: var(--accent-2); }

/* legacy irc_line() output, kept for any older templates */
.line { margin: 0 0 .3rem; font: .88rem/1.55 var(--mono); color: var(--text-2); }
.line .ts { color: #5d6980; }
.line .nick { color: var(--accent-2); font-weight: 600; }
.line .nick-server { color: var(--muted); }

/* ---------- motion ---------- */
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(52,211,153,.55); } 70%, 100% { box-shadow: 0 0 0 8px rgba(52,211,153,0); } }
@keyframes flicker { 0%, 100% { opacity: 1; } 47% { opacity: .92; } 50% { opacity: 1; } 52% { opacity: .95; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .cursor { opacity: 1; }
}

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .grid-4, .server-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .span-2, .hero-span { grid-column: auto; }
  .docs-layout { grid-template-columns: minmax(0, 1fr); }
  .docs-nav { position: static; max-height: none; flex-direction: row; flex-wrap: wrap; }
  .docs-nav .group { flex-basis: 100%; }
  .docs-pick { grid-template-columns: minmax(0, 1fr); }
  .irpg-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .grid-2, .grid-4, .server-grid { grid-template-columns: minmax(0, 1fr); }
  .banner-wide { display: none; }
  .banner-narrow { display: inline; }
  .banner { font-size: clamp(8px, 2.75vw, 12px); }
  .crt-screen { padding: 1.1rem 1rem 1rem; }
  .crt-stats { grid-template-columns: repeat(2, 1fr); }
  .crt-stats dd { font-size: 1.35rem; }
  .hero-cta .btn { flex: 1; justify-content: center; }
  .chip { font-size: .84rem; }
  .chips li { flex-direction: column; align-items: flex-start; gap: .25rem; }
  .chips .desc { font-size: .82rem; padding-left: .2rem; }
  .irc-form { grid-template-columns: minmax(0, 1fr); }
  .card-head { flex-direction: column; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .statusline-right { margin-left: 0; flex-basis: 100%; }
  .ticker-link { display: none; }
  table.data th, table.data td, .irpg-table th, .irpg-table td { padding: .55rem .65rem; }
}
@media print {
  .site-header, .statusline, .ticker, .crt, .toast, .copy { display: none !important; }
  body { background: #fff; color: #000; }
}

/* audit fixes 2026-10-22 */
[hidden] { display: none !important; }              /* e.g. copy buttons stay hidden without JS */
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }  /* link-form honeypot */
