:root {
  --bg: #0b0d10;
  --bg-elevated: #12151a;
  --bg-card: #161a21;
  --border: #252b36;
  --border-strong: #343c4a;
  --text: #e8ecf1;
  --text-muted: #9aa3b2;
  --text-dim: #6b7382;
  --accent: #7c9cff;
  --accent-soft: rgba(124, 156, 255, 0.12);
  --accent-hover: #9bb3ff;
  --success: #5dcea3;
  --warning: #e6b35a;
  --oss: #5dcea3;
  --hosted: #7c9cff;
  --both: #c9a0ff;
  --radius: 10px;
  --font: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", "SF Mono", ui-monospace, monospace;
  --max: 1080px;
  --shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 8px 32px rgba(0,0,0,0.35);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(11, 13, 16, 0.85);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.logo:hover { text-decoration: none; color: var(--text); }

.logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, #4a6cf7, #a78bfa);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
  font-size: 0.9rem;
}

.nav-links a { color: var(--text-muted); text-decoration: none; }
.nav-links a:hover { color: var(--text); }

.nav-cta {
  background: var(--accent-soft);
  color: var(--accent) !important;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(124, 156, 255, 0.25);
}

.nav-cta:hover { background: rgba(124, 156, 255, 0.2); text-decoration: none !important; }

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.4rem 0.65rem;
  cursor: pointer;
  font-size: 0.85rem;
}

/* Hero */
.hero {
  padding: 4.5rem 0 3.5rem;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -20% 20% auto;
  height: 420px;
  background: radial-gradient(ellipse, rgba(124, 156, 255, 0.14), transparent 65%);
  pointer-events: none;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(124, 156, 255, 0.22);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.15rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.12;
  max-width: 18ch;
  margin-bottom: 1rem;
}

.hero h1 span { color: var(--accent); }

.tagline {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 38rem;
  margin-bottom: 1.75rem;
}

.tagline strong { color: var(--text); font-weight: 500; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.15rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--accent);
  color: #0b0d10;
}

.btn-primary:hover { background: var(--accent-hover); color: #0b0d10; }

.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-ghost:hover { border-color: var(--text-muted); color: var(--text); }

.thesis-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}

.thesis-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}

.thesis-card h3 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  letter-spacing: -0.01em;
}

.thesis-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Sections */
section { padding: 3.5rem 0; border-bottom: 1px solid var(--border); }

.section-head {
  margin-bottom: 1.75rem;
}

.section-head h2 {
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  letter-spacing: -0.025em;
  margin-bottom: 0.45rem;
}

.section-head p {
  color: var(--text-muted);
  max-width: 40rem;
  font-size: 0.98rem;
}

.mono-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
}

/* Directory controls */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
  align-items: center;
}

.search {
  flex: 1 1 200px;
  min-width: 180px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 0.6rem 0.85rem;
  font: inherit;
  font-size: 0.9rem;
}

.search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search::placeholder { color: var(--text-dim); }

.filter-chip {
  font-size: 0.8rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
}

.filter-chip.active, .filter-chip:hover {
  border-color: rgba(124, 156, 255, 0.4);
  color: var(--accent);
  background: var(--accent-soft);
}

/* Table */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
}

table.directory {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  min-width: 780px;
}

.directory th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.25);
  white-space: nowrap;
}

.directory td {
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text-muted);
}

.directory tr:last-child td { border-bottom: none; }

.directory tr:hover td { background: rgba(124, 156, 255, 0.04); }

.tool-name {
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.tool-name a { color: var(--text); text-decoration: none; }
.tool-name a:hover { color: var(--accent); }

.one-liner { max-width: 22rem; }

.badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.68rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  white-space: nowrap;
}

.badge-oss { color: var(--oss); border-color: rgba(93, 206, 163, 0.35); background: rgba(93, 206, 163, 0.08); }
.badge-hosted { color: var(--hosted); border-color: rgba(124, 156, 255, 0.35); background: var(--accent-soft); }
.badge-both { color: var(--both); border-color: rgba(201, 160, 255, 0.35); background: rgba(201, 160, 255, 0.08); }
.badge-docs { color: var(--warning); border-color: rgba(230, 179, 90, 0.35); background: rgba(230, 179, 90, 0.08); }

.ext-link {
  font-family: var(--mono);
  font-size: 0.75rem;
  white-space: nowrap;
}

/* Cards (mobile alt view) */
.cards { display: none; gap: 0.85rem; }

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.card h3 { font-size: 1.05rem; letter-spacing: -0.02em; }
.card h3 a { color: var(--text); text-decoration: none; }
.card h3 a:hover { color: var(--accent); }

.card p { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 0.85rem; }

.card-meta {
  display: grid;
  gap: 0.45rem;
  font-size: 0.8rem;
}

.card-meta dt {
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.card-meta dd { color: var(--text-muted); margin-bottom: 0.35rem; }

.empty-state {
  display: none;
  text-align: center;
  padding: 2rem;
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* Methodology */
.method-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.25rem;
}

.panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem;
}

.panel h3 {
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.65rem;
}

.panel p, .panel li {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.panel ul {
  margin: 0.75rem 0 0 1.1rem;
  display: grid;
  gap: 0.45rem;
}

.callout {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin-top: 1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--warning);
  background: rgba(230, 179, 90, 0.1);
  border: 1px solid rgba(230, 179, 90, 0.3);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  margin-bottom: 0.85rem;
}

.status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warning);
}

/* Waitlist */
.waitlist {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(124, 156, 255, 0.12), transparent 50%),
    var(--bg);
}

.waitlist-box {
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
}

.waitlist-box h2 { margin-bottom: 0.5rem; }
.waitlist-box > p { color: var(--text-muted); margin-bottom: 1.35rem; }

.form-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.form-row input[type="email"] {
  flex: 1 1 220px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--text);
  padding: 0.75rem 1rem;
  font: inherit;
}

.form-row input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-note {
  margin-top: 0.85rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.form-msg {
  margin-top: 1rem;
  font-size: 0.9rem;
  min-height: 1.4em;
}

.form-msg.ok { color: var(--success); }
.form-msg.err { color: #f07178; }

/* About */
.about-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.about-grid .panel h3 { font-size: 0.95rem; }

/* Footer */
.footer {
  padding: 2.5rem 0 3rem;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem;
}

.footer strong { color: var(--text-muted); font-weight: 500; }

.footer-links {
  display: flex;
  gap: 1.25rem;
  list-style: none;
}

.footer-links a { color: var(--text-dim); text-decoration: none; }
.footer-links a:hover { color: var(--text-muted); }

/* Responsive */
@media (max-width: 820px) {
  .thesis-grid { grid-template-columns: 1fr; }
  .method-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .table-wrap { display: none; }
  .cards { display: grid; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem 1rem;
    gap: 0.5rem;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: inline-flex; }
  .nav { position: relative; }
  .hero { padding-top: 3rem; }
}

@media (max-width: 480px) {
  .hero h1 { max-width: none; }
  .form-row { flex-direction: column; }
  .form-row .btn { width: 100%; }
}

.contact-fields { display: grid; gap: 0.75rem; max-width: 560px; }
.contact-fields input, .contact-fields textarea {
  width: 100%; padding: 0.8rem 0.9rem; border-radius: 10px; font: inherit;
  background: var(--bg, #0b0d10); color: var(--text, #e8eaed); border: 1px solid rgba(255,255,255,0.15);
}
.contact-fields textarea { resize: vertical; min-height: 120px; }
.contact-fields .btn { justify-self: start; }
#contact { padding-top: 0; }

/* Scoreboard v7 */
.bench-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.bench-blurb {
  color: var(--text-muted);
  font-size: 0.92rem;
  max-width: 46rem;
  margin-bottom: 0.35rem;
}

.rank-scope {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.1rem;
}

.score-controls {
  align-items: flex-end;
}

.control-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.control-label select {
  font-family: var(--font);
  font-size: 0.85rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  min-width: 11rem;
  cursor: pointer;
}

.control-label select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.rank-cell {
  white-space: nowrap;
}

.rank-num {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--accent);
  font-size: 0.85rem;
}

/* v13 form labels */
.field-label { display: block; font-size: 0.85rem; font-weight: 600; margin: 0 0 0.35rem; opacity: 0.85; }
.contact-fields .field-label { margin-bottom: -0.4rem; }
.bench-tabs { scrollbar-width: thin; }

/* v14: Context Map + Amnesia Audit */
.bucket-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.bucket-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.bucket-card h3 { margin: 0.25rem 0 0.5rem; }
.bucket-card p { color: var(--text-muted); margin: 0 0 0.6rem; }
.bucket-card .bucket-fail { font-size: 0.92rem; }
.bucket-ranked { border-color: var(--accent); background: linear-gradient(180deg, var(--accent-soft), var(--bg-card)); }
.bucket-flag { color: var(--text) !important; font-weight: 500; }
.scoreboard-callout { margin-top: 1.5rem; }
.audit-list { list-style: decimal; padding-left: 1.5rem; display: grid; gap: 0.75rem; max-width: 760px; }
.audit-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.9rem 1rem; }
.audit-item label { display: flex; gap: 0.75rem; align-items: flex-start; cursor: pointer; }
.audit-item input { margin-top: 0.3rem; width: 1.1rem; height: 1.1rem; accent-color: var(--accent); flex: none; }
.audit-hint { color: var(--text-muted); font-size: 0.92rem; }
@media print {
  .nav, .footer, .waitlist, .hero-actions { display: none !important; }
  body { background: #fff; color: #000; }
  .audit-item, .bucket-card { background: #fff; border-color: #999; box-shadow: none; }
  .audit-hint, .bucket-card p { color: #333; }
}
