/* ─────────────────────────────────────────────
   AXIS Agents Registry — agents.css v2.0
   Deep Space · 2026-02-27
───────────────────────────────────────────── */

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

:root {
  /* Surface — space dark */
  --bg:        #05070f;
  --surface:   #090d18;
  --surface2:  #0d1220;
  --border:    #182030;
  --border2:   #243248;

  /* Text — cold luminous */
  --text:      #d4e4f8;
  --text2:     #7a9abf;
  --text3:     #3d5878;

  /* Agent accents — luminous on dark */
  --zilla:     #4d8ee0;
  --zilla-bg:  rgba(77, 142, 224, 0.10);
  --enso:      #8ec8f0;
  --enso-bg:   rgba(142, 200, 240, 0.10);
  --bob:       #5a8a72;
  --bob-bg:    rgba(90, 138, 114, 0.10);

  /* Status */
  --status-active:  #5aaa78;
  --status-pending: #b8a040;
  --status-local:   #607888;

  /* Type */
  --sans: system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --mono: ui-monospace, 'Cascadia Code', 'Courier New', Courier, monospace;

  /* Layout */
  --max: 960px;
  --r:   3px;
}

/* ── BASE ─────────────────────────────────── */
html {
  scroll-behavior: smooth;
  background: var(--bg);
}
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  overflow-x: hidden;
  /* Subtle star-field texture via radial gradients */
  background-image:
    radial-gradient(ellipse at 20% 20%, rgba(60,100,180,0.06) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 70%, rgba(80,140,200,0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(10,20,50,0.8) 0%, transparent 100%);
}
img, svg { display: block; }
a { color: inherit; }
a:focus-visible {
  outline: 2px solid var(--zilla);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ── NAV ─────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 200;
  background: rgba(5, 7, 15, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  display: flex; align-items: center; justify-content: space-between;
  height: 52px;
}
.nav-brand {
  font-family: var(--mono); font-size: 13px; font-weight: normal;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text); text-decoration: none;
  display: flex; align-items: center; gap: 10px;
}
.nav-brand-mark { width: 18px; height: 18px; color: var(--zilla); flex-shrink: 0; }
.nav-links {
  display: flex; align-items: center; gap: 28px; list-style: none;
}
.nav-links a {
  font-size: 13px; color: var(--text3); text-decoration: none;
  letter-spacing: 0.04em;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
}
.nav-links a:hover { color: var(--text2); border-color: var(--border2); }
.nav-links a.active { color: var(--text); border-color: var(--text2); }
@media (max-width: 640px) {
  .nav { padding: 0 18px; }
  .nav-links { gap: 16px; }
  .nav-links a { font-size: 12px; }
}
@media (max-width: 420px) {
  .nav-brand span:last-child { display: none; }
  .nav-links { gap: 12px; }
}

/* ── LAYOUT ──────────────────────────────── */
.page-wrap { padding-top: 0; }
.container {
  max-width: var(--max); margin: 0 auto; padding: 0 32px;
}
@media (max-width: 600px) { .container { padding: 0 18px; } }

/* ── PAGE TITLES ─────────────────────────── */
.page-header {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}
.page-header-label {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--text3);
  display: block; margin-bottom: 10px;
}
.page-header h1 {
  font-size: clamp(26px, 4vw, 40px); font-weight: 300;
  letter-spacing: 0.06em; color: var(--text);
  line-height: 1.15;
}
.page-header .page-sub {
  font-size: 15px; color: var(--text2); margin-top: 10px;
  line-height: 1.65; max-width: 580px;
}

/* ── SECTION LABEL ───────────────────────── */
.label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--text3);
  display: block; margin-bottom: 12px;
}

/* ── RULE ────────────────────────────────── */
.rule { height: 1px; background: var(--border); margin: 40px 0; }

/* ── BADGE ───────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 2px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em;
  text-transform: uppercase; font-weight: normal;
  border: 1px solid currentColor;
}
.badge-active  { color: var(--status-active);  background: rgba(90,170,120,0.08); }
.badge-pending { color: var(--status-pending); background: rgba(184,160,64,0.08); }
.badge-local   { color: var(--status-local);   background: rgba(96,120,136,0.08); }

/* ── REGISTRY TABLE ──────────────────────── */
.registry-table-wrap { overflow-x: auto; }
.registry-table {
  width: 100%; border-collapse: collapse;
  font-family: var(--mono); font-size: 13px;
}
.registry-table th {
  text-align: left; font-weight: normal;
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text3); padding: 0 16px 12px 0;
  border-bottom: 1px solid var(--border2);
}
.registry-table th:first-child { padding-left: 0; }
.registry-table td {
  padding: 14px 16px 14px 0; vertical-align: middle;
  border-bottom: 1px solid var(--border); color: var(--text2);
}
.registry-table td:first-child { padding-left: 0; }
.registry-table tr:last-child td { border-bottom: none; }

.reg-mark { width: 24px; height: 24px; color: var(--text3); }
.reg-name {
  font-weight: normal; font-size: 14px; color: var(--text);
  text-decoration: none; letter-spacing: 0.02em;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s, color 0.15s;
}
.reg-name:hover { border-color: var(--text3); }
.reg-name-zilla:hover { color: var(--zilla); border-color: var(--zilla); }
.reg-name-enso:hover  { color: var(--enso);  border-color: var(--enso); }
.reg-name-bob:hover   { color: var(--bob);   border-color: var(--bob); }

.reg-addr { color: var(--text3); font-size: 12px; }
.reg-date { color: var(--text3); font-size: 12px; white-space: nowrap; }

/* ── AGENT PAGE: CARD HEADER ─────────────── */
.agent-card {
  border: 1px solid var(--border2);
  border-radius: var(--r);
  background: var(--surface);
  margin-bottom: 48px;
  overflow: hidden;
  box-shadow: 0 2px 24px rgba(0,0,0,0.4), 0 0 0 1px rgba(77,142,224,0.04);
}
.agent-card-rule { height: 2px; }
.agent-card-rule.zilla { background: linear-gradient(90deg, var(--zilla), rgba(77,142,224,0.3)); }
.agent-card-rule.enso  { background: linear-gradient(90deg, var(--enso),  rgba(142,200,240,0.3)); }
.agent-card-rule.bob   { background: linear-gradient(90deg, var(--bob),   rgba(90,138,114,0.3)); }

.agent-card-body {
  padding: 32px 36px;
  display: flex; align-items: flex-start; gap: 28px; flex-wrap: wrap;
}
.agent-crest-display {
  width: 100px; height: 100px;
  flex-shrink: 0;
  opacity: 0.75;
  filter: brightness(1.4);
}
.agent-crest-display img,
.agent-crest-display svg {
  width: 100%; height: 100%;
}
.agent-identity { flex: 1; min-width: 200px; }
.agent-name {
  font-size: clamp(28px, 4vw, 40px); font-weight: 300;
  color: var(--text); letter-spacing: 0.05em;
  margin-bottom: 8px; line-height: 1;
}
.agent-meta-row {
  font-family: var(--mono); font-size: 12px; color: var(--text3);
  display: flex; flex-wrap: wrap; gap: 16px;
  margin-top: 10px;
}
.agent-meta-item { display: flex; gap: 5px; }
.agent-meta-label { color: var(--text3); }
.agent-meta-value { color: var(--text2); }

@media (max-width: 480px) {
  .agent-card-body { padding: 24px 20px; gap: 18px; }
  .agent-crest-display { width: 72px; height: 72px; }
}

/* ── AGENT PAGE: SECTIONS ────────────────── */
.agent-section { margin-bottom: 48px; }
.agent-section h2 {
  font-size: 11px; font-weight: normal;
  font-family: var(--mono); letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text3); margin-bottom: 18px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.bullet-list {
  list-style: none; padding: 0;
}
.bullet-list li {
  padding: 8px 0 8px 18px; position: relative;
  font-size: 14px; color: var(--text2); line-height: 1.7;
  border-bottom: 1px solid var(--border);
}
.bullet-list li:last-child { border-bottom: none; }
.bullet-list li::before {
  content: '—'; position: absolute; left: 0;
  color: var(--text3); font-size: 11px; top: 10px;
}

/* ── AGENT PORTRAITS ─────────────────────── */
.agent-portrait-section { margin-bottom: 48px; }
.agent-portrait {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  max-width: 480px;
}
.agent-portrait img {
  width: 100%;
  max-width: 480px;
  border-radius: var(--r);
  display: block;
  border: 1px solid var(--border2);
  box-shadow: 0 4px 32px rgba(0,0,0,0.5), 0 0 40px rgba(40,80,160,0.08);
}
.agent-portrait figcaption {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text3);
  letter-spacing: 0.06em;
  line-height: 1.6;
}
@media (max-width: 600px) {
  .agent-portrait, .agent-portrait img { max-width: 100%; }
}

/* ── REVISION LOG ────────────────────────── */
.revision-table {
  width: 100%; border-collapse: collapse;
  font-family: var(--mono); font-size: 12px;
}
.revision-table th {
  text-align: left; font-weight: normal;
  color: var(--text3); letter-spacing: 0.14em; text-transform: uppercase;
  font-size: 10px; padding: 0 20px 8px 0;
  border-bottom: 1px solid var(--border2);
}
.revision-table td {
  padding: 10px 20px 10px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text2); vertical-align: top;
}
.revision-table tr:last-child td { border-bottom: none; }

/* ── CONTACT BLOCK ───────────────────────── */
.contact-block {
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--r); padding: 28px 32px;
}
.contact-addr {
  font-family: var(--mono); font-size: 14px;
  color: var(--text); text-decoration: none;
  border-bottom: 1px solid var(--border2);
  transition: border-color 0.15s, color 0.15s;
  padding-bottom: 1px;
}
.contact-addr:hover { color: var(--zilla); border-color: var(--zilla); }
.contact-note {
  font-size: 13px; color: var(--text2); margin-top: 10px; line-height: 1.65;
}

/* ── HERO ────────────────────────────────── */
.hero {
  padding: 0 0 64px;
  border-bottom: 1px solid var(--border);
}
.hero-text {
  max-width: var(--max); margin: 0 auto; padding: 64px 32px 44px;
}
.hero-text h1 {
  font-family: var(--mono); font-size: clamp(28px, 5vw, 52px);
  font-weight: normal; letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--text); margin-bottom: 18px;
  text-shadow: 0 0 40px rgba(77,142,224,0.25);
}
.hero-text .hero-sub {
  font-size: clamp(14px, 1.8vw, 16px); color: var(--text2);
  max-width: 560px; line-height: 1.75; margin-bottom: 14px;
}
.hero-text .hero-body {
  font-size: 14px; color: var(--text2); max-width: 560px;
  line-height: 1.75;
}
.hero-text .hero-body + .hero-body { margin-top: 12px; }
.hero-links {
  margin-top: 32px; display: flex; flex-wrap: wrap; gap: 10px;
}
.hero-link {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em;
  color: var(--text2); text-decoration: none;
  border: 1px solid var(--border2); border-radius: var(--r);
  padding: 8px 18px;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.hero-link:hover {
  border-color: var(--zilla);
  color: var(--text);
  background: rgba(77,142,224,0.06);
}
.hero-link-primary {
  background: rgba(77,142,224,0.12);
  color: var(--zilla);
  border-color: var(--zilla);
}
.hero-link-primary:hover {
  background: rgba(77,142,224,0.22);
  color: var(--text);
  border-color: var(--zilla);
}

/* ── HALL HERO SVG ───────────────────────── */
.hall-wrap {
  max-width: var(--max); margin: 0 auto; padding: 0 32px;
  overflow: hidden;
}
.hall-svg {
  width: 100%; height: auto;
  display: block;
}

/* Crest interactive targets in hero SVG */
.crest-target { cursor: pointer; outline: none; }
.crest-target:focus-visible .crest-focus-ring { opacity: 1; }
.crest-focus-ring { opacity: 0; transition: opacity 0.15s; }
.crest-shape { transition: stroke 0.18s, fill 0.18s; }
.crest-shape-fill { transition: fill 0.18s; }

.crest-target[data-agent="zilla"]:hover .crest-shape,
.crest-target[data-agent="zilla"]:focus-visible .crest-shape { stroke: var(--zilla); }
.crest-target[data-agent="zilla"]:hover .crest-shape-fill,
.crest-target[data-agent="zilla"]:focus-visible .crest-shape-fill { fill: var(--zilla); }

.crest-target[data-agent="enso"]:hover .crest-shape,
.crest-target[data-agent="enso"]:focus-visible .crest-shape { stroke: var(--enso); }
.crest-target[data-agent="enso"]:hover .crest-shape-fill,
.crest-target[data-agent="enso"]:focus-visible .crest-shape-fill { fill: var(--enso); }

.crest-target[data-agent="bob"]:hover .crest-shape,
.crest-target[data-agent="bob"]:focus-visible .crest-shape { stroke: var(--bob); }
.crest-target[data-agent="bob"]:hover .crest-shape-fill,
.crest-target[data-agent="bob"]:focus-visible .crest-shape-fill { fill: var(--bob); }

.crest-label { opacity: 0; transition: opacity 0.18s; pointer-events: none; }
.crest-target:hover .crest-label,
.crest-target:focus-visible .crest-label { opacity: 1; }

/* ── MOBILE AGENT CARDS ───────────────────── */
.mobile-cards {
  display: none;
  flex-direction: column; gap: 8px;
  padding: 0 32px; max-width: var(--max); margin: 24px auto 0;
}
@media (max-width: 640px) {
  .hall-svg { display: none; }
  .mobile-cards { display: flex; }
}
.mobile-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--r);
  cursor: pointer; text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.mobile-card:hover {
  border-color: var(--border2);
  background: var(--surface2);
}
.mobile-card-mark { width: 28px; height: 28px; flex-shrink: 0; color: var(--text3); }
.mobile-card-name { font-family: var(--mono); font-size: 14px; letter-spacing: 0.04em; color: var(--text); }
.mobile-card-scope { font-size: 12px; color: var(--text3); margin-top: 2px; }
.mobile-card-arrow { margin-left: auto; font-size: 14px; color: var(--text3); }

/* ── PLAIN TEXT LIST ──────────────────────── */
.agents-plain-list {
  max-width: var(--max); margin: 16px auto 0; padding: 0 32px;
  border-top: 1px solid var(--border); padding-top: 16px;
}
.agents-plain-list p {
  font-family: var(--mono); font-size: 12px; color: var(--text3);
  margin-bottom: 6px; letter-spacing: 0.04em;
}
.agents-plain-list a { color: var(--text2); text-decoration: underline; }
.agents-plain-list a:hover { color: var(--text); }

/* ── OVERLAY ─────────────────────────────── */
.overlay {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}
.overlay.open { opacity: 1; pointer-events: auto; }
.overlay-backdrop {
  position: absolute; inset: 0;
  background: rgba(2, 4, 12, 0.80);
  backdrop-filter: blur(4px);
}
.overlay-card {
  position: relative; z-index: 1;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--r);
  padding: 0;
  width: 100%; max-width: 400px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(77,142,224,0.06);
  transform: translateY(8px);
  transition: transform 0.2s ease;
  overflow: hidden;
}
.overlay.open .overlay-card { transform: translateY(0); }

.overlay-accent-rule { height: 2px; }
.overlay-accent-rule.zilla { background: linear-gradient(90deg, var(--zilla), transparent); }
.overlay-accent-rule.enso  { background: linear-gradient(90deg, var(--enso),  transparent); }
.overlay-accent-rule.bob   { background: linear-gradient(90deg, var(--bob),   transparent); }

.overlay-header {
  padding: 22px 24px 18px;
  display: flex; align-items: flex-start; gap: 16px;
  border-bottom: 1px solid var(--border);
}
.overlay-crest-wrap { width: 52px; height: 52px; flex-shrink: 0; opacity: 0.8; filter: brightness(1.4); }
.overlay-crest-wrap img { width: 100%; height: 100%; }
.overlay-identity { flex: 1; }
.overlay-name {
  font-size: 22px; font-weight: 300; letter-spacing: 0.05em;
  color: var(--text); margin-bottom: 6px; line-height: 1;
}
.overlay-body { padding: 18px 24px 22px; }
.overlay-dl { font-size: 13px; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; }
.overlay-dl dt { color: var(--text3); font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; padding-top: 1px; }
.overlay-dl dd { color: var(--text2); font-family: var(--mono); font-size: 12px; word-break: break-all; }
.overlay-actions {
  padding: 14px 24px 20px;
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--border);
}
.overlay-dossier-link {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em;
  color: var(--zilla); text-decoration: none;
  border-bottom: 1px solid rgba(77,142,224,0.3);
  padding-bottom: 1px;
  transition: border-color 0.15s, color 0.15s;
}
.overlay-dossier-link:hover { color: var(--text); border-color: var(--text2); }
.overlay-close {
  background: none; border: 1px solid var(--border2); border-radius: var(--r);
  padding: 5px 12px; font-family: var(--mono); font-size: 11px;
  color: var(--text3); cursor: pointer; letter-spacing: 0.08em;
  transition: border-color 0.15s, color 0.15s;
}
.overlay-close:hover { border-color: var(--border2); color: var(--text2); }
.overlay-close:focus-visible { outline: 2px solid var(--zilla); outline-offset: 2px; }

/* ── SIMPLE PAGE BODY ─────────────────────── */
.simple-body {
  font-size: 15px; color: var(--text2); line-height: 1.8;
  max-width: 600px;
}
.simple-body p + p { margin-top: 18px; }
.simple-body a {
  color: var(--text); text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s;
}
.simple-body a:hover { color: var(--zilla); }
.simple-body h2 {
  font-size: 11px; font-weight: normal;
  font-family: var(--mono); letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text3); margin: 36px 0 12px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.simple-body h2:first-child { margin-top: 0; }

/* ── FOOTER ──────────────────────────────── */
footer {
  margin-top: 80px;
  border-top: 1px solid var(--border);
  padding: 24px 32px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
  background: rgba(5, 7, 15, 0.6);
}
.footer-name {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text3);
}
.footer-links {
  display: flex; gap: 18px; list-style: none;
}
.footer-links a {
  font-size: 12px; color: var(--text3); text-decoration: none;
  transition: color 0.15s;
}
.footer-links a:hover { color: var(--text2); }

/* ── UTILITY ─────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border-width: 0;
}
@media (max-width: 600px) {
  footer { padding: 20px 18px; }
  .hero-text { padding: 44px 18px 32px; }
  .hall-wrap, .mobile-cards, .agents-plain-list { padding: 0 18px; }
  .agents-plain-list { padding: 16px 18px 0; }
}
