/* main.css — Core CSS: variables, reset, body, typography, layout, hero, stats, cards, groups, tables, status labels, footer */

:root {
  color-scheme: dark;
  --bg: #050814;
  --bg2: #081120;
  --panel: #0b1428;
  --panel2: #101b33;
  --line: #1c2b48;
  --line2: #2c4774;
  --text: #e4ecff;
  --muted: #8ea2c4;
  --soft: #bfccdf;
  --cyan: #4be7f2;
  --blue: #69a8ff;
  --green: #25d482;
  --yellow: #ffe070;
  --orange: #ffb454;
  --red: #ff6b88;
  --purple: #ba92ff;
  --max: 1320px;
  --radius: 15px;
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'Fira Code', 'JetBrains Mono', ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, Consolas, monospace;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: radial-gradient(ellipse at 20% -10%, #0e2247 0%, transparent 50%),
              radial-gradient(ellipse at 80% 100%, #091a3a 0%, transparent 50%),
              linear-gradient(180deg, #050814 0%, #070b16 50%, #050814 100%);
  color: var(--text);
  font: 15px/1.6 var(--font);
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar (webkit) */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* Links */
a { color: var(--cyan); text-decoration: none; transition: color .2s; }
a:hover { text-decoration: underline; color: var(--blue); }

/* Focus styles */
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  border-radius: 4px;
}
button:focus-visible, a:focus-visible { outline-offset: 3px; }

/* Typography */
h1, h2, h3, h4, h5, h6 { line-height: 1.25; letter-spacing: -0.01em; }
p { margin: 0 0 12px; }
strong { font-weight: 700; }

/* Page container */
.page {
  max-width: var(--max);
  margin: auto;
  padding: 20px 20px 0;
}

/* ─── Hero section ─── */
.hero {
  padding: 36px 0 16px;
  position: relative;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: -20px; right: -20px;
  height: 100%;
  background: linear-gradient(135deg, rgba(75,231,242,.04) 0%, rgba(105,168,255,.03) 50%, transparent 100%);
  border-radius: 0 0 20px 20px;
  pointer-events: none;
  z-index: -1;
}
.hero .kicker, .hero .eyebrow {
  font-size: 11px;
  letter-spacing: .2em;
  
  color: var(--cyan);
  font-weight: 700;
  margin-bottom: 6px;
  opacity: .9;
}
.hero h1 {
  margin: 0 0 10px;
  font-size: 34px;
  font-weight: 850;
  color: #fff;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff 60%, var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero .sub {
  color: var(--muted);
  max-width: 720px;
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
}

/* ─── Breadcrumb + TOC bar ─── */
.crumbtoc {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 0 4px;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid rgba(28,43,72,.4);
  margin-bottom: 4px;
}
.crumbs { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.crumbs a { color: var(--soft); transition: color .15s; }
.crumbs a:hover { color: var(--cyan); text-decoration: none; }
.crumbs span[aria-hidden="true"] { color: var(--muted); opacity: .6; }
.crumbs strong { color: #fff; font-weight: 700; }
.toc { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toc span { color: var(--muted); font-weight: 700; font-size: 11px;  letter-spacing: .08em; }
.toc a {
  color: var(--soft);
  font-size: 12px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: all .2s;
}
.toc a:hover { border-color: var(--cyan); color: var(--cyan); text-decoration: none; background: rgba(75,231,242,.05); }

/* ─── Stats row ─── */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.stat {
  background: linear-gradient(145deg, var(--panel) 0%, rgba(11,20,40,.6) 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  text-align: center;
  transition: transform .2s, box-shadow .3s, border-color .3s;
  backdrop-filter: blur(8px);
}
.stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,0,0,.3);
  border-color: var(--line2);
}
.stat b {
  display: block;
  font-size: 24px;
  color: #fff;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.stat span {
  font-size: 11px;
  color: var(--muted);
  
  letter-spacing: .12em;
  font-weight: 600;
}

/* ─── Section + panels ─── */
.section { margin-top: 30px; }
.section h2 {
  font-size: 16px;
  letter-spacing: .08em;
  
  color: var(--cyan);
  margin: 0 0 16px;
  font-weight: 700;
}
.panel {
  background: linear-gradient(145deg, rgba(11,20,40,.85) 0%, rgba(16,27,51,.6) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 18px;
  backdrop-filter: blur(12px);
  transition: border-color .3s;
  position: relative;
}
.panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--cyan), var(--blue));
  border-radius: var(--radius) 0 0 var(--radius);
  opacity: .5;
  transition: opacity .3s;
}
.panel:hover::before { opacity: 1; }
.panel:hover { border-color: var(--line2); }
.panel-body { padding: 20px 22px; }

/* ─── Cards grid ─── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.card {
  background: linear-gradient(145deg, rgba(11,20,40,.9) 0%, rgba(16,27,51,.5) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  transition: all .25s ease;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  padding: 1px;
  background: linear-gradient(135deg, transparent 40%, rgba(75,231,242,.15));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s;
}
.card:hover::after { opacity: 1; }
.card:hover {
  border-color: rgba(75,231,242,.2);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0,0,0,.3);
}
.card b { display: block; margin-bottom: 8px; color: #fff; font-size: 15px; }
.card p { margin: 0 0 10px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.card a { font-size: 13px; font-weight: 700; transition: color .2s; }
.card a:hover { color: var(--blue); }

/* ─── Layout with sidebar ─── */
.layout { display: grid; grid-template-columns: 1fr 300px; gap: 18px; }
.layout aside { position: sticky; top: 70px; align-self: start; }

/* ─── Lists ─── */
.list { list-style: none; margin: 0; padding: 0; }
.list li {
  padding: 10px 0;
  border-bottom: 1px solid rgba(28,43,72,.4);
  color: var(--soft);
  font-size: 13px;
  line-height: 1.55;
  transition: color .15s;
}
.list li:last-child { border-bottom: none; }
.list li:hover { color: var(--text); }

/* ─── Tables ─── */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(11,20,40,.6);
  backdrop-filter: blur(8px);
}
.model-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.model-table th {
  text-align: left;
  padding: 13px 14px;
  background: linear-gradient(180deg, var(--panel2) 0%, rgba(11,20,40,.8) 100%);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .1em;
  
  font-weight: 700;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
.model-table th:hover { color: var(--cyan); }
.model-table th.sort-active { color: var(--cyan); }
.sort-arrow { font-size: 10px; margin-left: 4px; opacity: .7; }
.model-table td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(28,43,72,.3);
  vertical-align: middle;
  transition: background .15s;
}
.model-table tr:last-child td { border-bottom: none; }
.model-table tbody tr:nth-child(even) { background: rgba(255,255,255,.015); }
.model-table tbody tr:hover td { background: rgba(75,231,242,.04); }
.model-name { font-weight: 700; white-space: nowrap; }
.model-name a { color: #fff; text-decoration: none; font-weight: 700; transition: color .15s; }
.model-name a:hover { color: var(--cyan); text-decoration: none; }
.provider { color: var(--soft); }
.price { font-weight: 600; white-space: nowrap; }
.price-na { color: var(--green); font-weight: 700; }
.last-checked { color: var(--muted); font-size: 12px; white-space: nowrap; }
.usecase { display: flex; gap: 4px; flex-wrap: wrap; }
.tag {
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(75,231,242,.08);
  border: 1px solid rgba(75,231,242,.15);
  color: var(--cyan);
  font-weight: 600;
  letter-spacing: .02em;
}

/* ─── Status labels ─── */
.status {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  
  line-height: 1.6;
  white-space: nowrap;
}
.status-useful { background: rgba(37,212,130,.12); color: var(--green); border: 1px solid rgba(37,212,130,.25); box-shadow: 0 0 8px rgba(37,212,130,.08); }
.status-adopted { background: rgba(105,168,255,.12); color: var(--blue); border: 1px solid rgba(105,168,255,.25); box-shadow: 0 0 8px rgba(105,168,255,.08); }
.status-rejected { background: rgba(255,107,136,.12); color: var(--red); border: 1px solid rgba(255,107,136,.25); box-shadow: 0 0 8px rgba(255,107,136,.08); }
.status-monitoring { background: rgba(255,224,112,.1); color: var(--yellow); border: 1px solid rgba(255,224,112,.2); box-shadow: 0 0 8px rgba(255,224,112,.06); }
.status-later { background: rgba(186,146,255,.1); color: var(--purple); border: 1px solid rgba(186,146,255,.2); box-shadow: 0 0 8px rgba(186,146,255,.06); }
.status-outdated { background: rgba(142,162,196,.08); color: var(--muted); border: 1px solid rgba(142,162,196,.15); }

/* ─── Grouped link sections ─── */
.group {
  margin: 26px 0;
  position: relative;
  padding-left: 16px;
}
.group::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--cyan), var(--blue), transparent);
  border-radius: 2px;
  opacity: .4;
}
.group h2 {
  font-size: 16px;
  margin: 0 0 14px;
  color: var(--cyan);
  letter-spacing: .05em;
  font-weight: 700;
}

/* ─── Link list grid ─── */
.linklist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 12px;
}

/* ─── Link item cards ─── */
.linkitem {
  display: block;
  background: linear-gradient(145deg, rgba(11,20,40,.9) 0%, rgba(16,27,51,.5) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  color: var(--text);
  text-decoration: none;
  transition: all .25s ease;
  backdrop-filter: blur(8px);
}
.linkitem:hover {
  border-color: var(--cyan);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,0,0,.25);
}
.linkitem b { display: block; margin-bottom: 4px; color: #fff; font-size: 14px; }
.link-desc { display: block; color: var(--soft); font-size: 13px; margin-bottom: 8px; }
.link-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.link-notes {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid rgba(28,43,72,.4);
  padding-top: 10px;
  line-height: 1.5;
}

/* ─── No results ─── */
.no-results { display: none; padding: 24px; text-align: center; color: var(--muted); font-size: 14px; }

/* ─── Sub-nav ─── */
.sub-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 0;
  border-bottom: 1px solid rgba(28,43,72,.4);
  margin-bottom: 8px;
}
.sub-nav a {
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--soft);
  font-size: 13px;
  font-weight: 600;
  transition: all .2s;
}
.sub-nav a:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  text-decoration: none;
  background: rgba(75,231,242,.05);
}

/* ─── Agent/Tool tables ─── */
.agent-table, .tool-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.agent-table th, .tool-table th {
  text-align: left;
  padding: 13px 14px;
  background: var(--panel2);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .1em;
  
  font-weight: 700;
  border-bottom: 1px solid var(--line);
}
.agent-table td, .tool-table td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(28,43,72,.3);
  vertical-align: top;
}
.agent-table tr:last-child td, .tool-table tr:last-child td { border-bottom: none; }
.agent-table tbody tr:nth-child(even), .tool-table tbody tr:nth-child(even) { background: rgba(255,255,255,.015); }
.agent-table tbody tr:hover td, .tool-table tbody tr:hover td { background: rgba(75,231,242,.04); }
.tool-name { font-weight: 700; color: #fff; white-space: nowrap; }

/* ─── Decision matrix ─── */
.decision-matrix { margin: 12px 0; }
.dm-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(28,43,72,.4);
  transition: background .15s;
}
.dm-row:last-child { border-bottom: none; }
.dm-row:hover { background: rgba(75,231,242,.03); }
.dm-scenario { flex: 1; color: var(--soft); font-size: 13px; }
.dm-arrow { color: var(--cyan); font-size: 16px; font-weight: 700; }
.dm-answer { flex: 1.5; color: #fff; font-weight: 600; font-size: 13px; }

/* ─── Principle list ─── */
.principle-list { list-style: none; margin: 0; padding: 0; }
.principle-item {
  padding: 14px 0;
  border-bottom: 1px solid rgba(28,43,72,.4);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.principle-item:last-child { border-bottom: none; }
.principle-item strong {
  color: var(--cyan);
  font-size: 14px;
  letter-spacing: .02em;
}
.principle-item span {
  color: var(--soft);
  font-size: 13px;
  line-height: 1.55;
}

/* ─── Active agents ─── */
.active-agents {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.agent-card {
  background: linear-gradient(145deg, rgba(11,20,40,.9) 0%, rgba(16,27,51,.5) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  transition: all .25s;
}
.agent-card:hover {
  border-color: var(--line2);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,0,0,.25);
}
.agent-card b { display: block; margin-bottom: 6px; color: #fff; font-size: 14px; }
.agent-card .meta { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.agent-card .detail { font-size: 13px; color: var(--soft); line-height: 1.5; }

/* ─── Cat grid (tools) ─── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.cat-card {
  background: linear-gradient(145deg, rgba(11,20,40,.9) 0%, rgba(16,27,51,.5) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  transition: all .25s;
}
.cat-card:hover {
  border-color: var(--line2);
  transform: translateY(-1px);
}
.cat-card b { display: block; margin-bottom: 6px; color: #fff; font-size: 14px; }
.cat-card p { margin: 0 0 8px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.tools-list { font-size: 12px; color: var(--cyan); font-weight: 600; }

/* ─── Setup grid ─── */
.setup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.setup-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.setup-card b { display: block; margin-bottom: 10px; font-size: 13px; }
.setup-card ul { list-style: none; margin: 0; padding: 0; }
.setup-card li {
  padding: 6px 0;
  border-bottom: 1px solid rgba(28,43,72,.4);
  font-size: 13px;
  color: var(--soft);
}
.setup-card li:last-child { border-bottom: none; }

/* ─── Footer ─── */
.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid rgba(28,43,72,.4);
  padding: 24px 0;
  margin-top: 48px;
}
.footer a { color: inherit; text-decoration: none; transition: color .15s; }
.footer a:hover { color: var(--text); }
.footer-path, .footer-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.footer-actions a {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.02);
  font-size: 12px;
  font-weight: 600;
  transition: all .2s;
}
.footer-actions a:hover { border-color: var(--line2); background: rgba(255,255,255,.04); }

/* ─── Responsive ─── */
@media(max-width:840px) {
  .stats, .grid, .linklist { grid-template-columns: 1fr; }
  .cc-grid { grid-template-columns: 1fr; }
  .layout { grid-template-columns: 1fr; }
  .layout aside { position: static; }
  .cards { grid-template-columns: 1fr; }
  .active-agents { grid-template-columns: 1fr; }
  .cat-grid, .setup-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 26px; }
  .group { padding-left: 12px; }
}
