/* The RAG Index — "vector field" aesthetic. Light, dotted field, indigo→magenta gradient.
   Sora (display) + Geist Mono (data). Card grid. */

:root {
  --bg: #f5f5fb;
  --bg2: #ececf6;
  --surface: #ffffff;
  --ink: #14131f;
  --muted: #5a5870;
  --faint: #9a98ad;
  --line: #e6e4f0;
  --line2: #d7d4e8;
  --indigo: #5b4bff;
  --magenta: #e0399a;
  --indigo-soft: #eae7ff;
  --shadow: 0 14px 34px -20px rgba(91,75,255,.4);
}
[data-theme="dark"] {
  --bg: #0c0b14; --bg2: #110f1c; --surface: #14121f; --ink: #efedf7; --muted: #9d9ab4;
  --faint: #635f7c; --line: #211d33; --line2: #2e2945; --indigo: #8b7dff; --magenta: #ff5cb0;
  --indigo-soft: #1a1530; --shadow: 0 18px 40px -22px rgba(0,0,0,.7);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--ink); position: relative; min-height: 100vh; overflow-x: hidden;
  font-family: "Geist Mono", ui-monospace, Menlo, monospace; line-height: 1.55; -webkit-font-smoothing: antialiased; }
/* dotted vector field */
body::before { content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .6;
  background-image: radial-gradient(var(--line2) 1.3px, transparent 1.3px); background-size: 26px 26px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 80%); }
.disp { font-family: "Sora", system-ui, sans-serif; }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 26px; position: relative; z-index: 1; }

header { border-bottom: 1px solid var(--line2); position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); }
.head-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 0; }
.brand { display: flex; align-items: center; gap: 10px; font-family: "Sora", sans-serif; font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.brand .node { width: 14px; height: 14px; border-radius: 50%; background: linear-gradient(135deg, var(--indigo), var(--magenta)); }
.head-actions { display: flex; align-items: center; gap: 15px; }
.head-actions a { color: var(--muted); text-decoration: none; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; transition: color .2s; }
.head-actions a:hover { color: var(--indigo); }
.theme-btn { background: var(--surface); border: 1px solid var(--line2); color: var(--ink); width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 13px; transition: border-color .2s; }
.theme-btn:hover { border-color: var(--indigo); }

.hero { padding: 64px 0 30px; }
.hero .kicker { font-size: 12px; letter-spacing: .24em; text-transform: uppercase; color: var(--indigo); }
.hero h1 { font-family: "Sora", sans-serif; font-weight: 700; font-size: clamp(40px, 6.5vw, 80px); line-height: 1; letter-spacing: -.03em; margin-top: 16px; max-width: 15ch; }
.hero h1 .grad { background: linear-gradient(120deg, var(--indigo), var(--magenta)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero .lede { margin-top: 22px; font-size: clamp(15px, 1.7vw, 18px); color: var(--muted); max-width: 60ch; }
.stats { display: flex; gap: 14px; margin-top: 32px; flex-wrap: wrap; }
.stat { background: var(--surface); border: 1px solid var(--line2); border-radius: 14px; padding: 16px 22px; min-width: 130px; }
.stat .num { font-family: "Sora", sans-serif; font-weight: 700; font-size: 30px; line-height: 1; background: linear-gradient(120deg, var(--indigo), var(--magenta)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.stat .lbl { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-top: 7px; }

.toolbar { position: sticky; top: 58px; z-index: 40; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); padding: 16px 0 12px; border-bottom: 1px solid var(--line); }
.search-row { display: flex; gap: 10px; flex-wrap: wrap; }
.search { flex: 1; min-width: 220px; display: flex; align-items: center; gap: 9px; background: var(--surface); border: 1px solid var(--line2); border-radius: 10px; padding: 10px 13px; transition: border-color .2s, box-shadow .2s; }
.search:focus-within { border-color: var(--indigo); box-shadow: 0 0 0 3px var(--indigo-soft); }
.search svg { width: 15px; height: 15px; color: var(--faint); flex: none; }
.search input { flex: 1; border: none; background: none; color: var(--ink); font-family: "Geist Mono", monospace; font-size: 13px; outline: none; }
.sort { display: flex; border: 1px solid var(--line2); border-radius: 10px; overflow: hidden; }
.sort button { background: var(--surface); border: none; border-right: 1px solid var(--line); padding: 10px 13px; cursor: pointer; font-family: "Geist Mono", monospace; font-size: 11px; text-transform: uppercase; color: var(--muted); transition: all .16s; }
.sort button:last-child { border: none; }
.sort button.active { background: linear-gradient(120deg, var(--indigo), var(--magenta)); color: #fff; }
.chips { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 12px; }
.chip { background: var(--surface); border: 1px solid var(--line2); border-radius: 100px; padding: 6px 12px; cursor: pointer; font-family: "Geist Mono", monospace; font-size: 11px; color: var(--muted); transition: all .16s; white-space: nowrap; }
.chip:hover { border-color: var(--indigo); color: var(--indigo); }
.chip.active { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.chip .ct { opacity: .6; margin-left: 5px; }

.meta-line { font-size: 11px; color: var(--faint); letter-spacing: .05em; padding: 20px 0 12px; text-transform: uppercase; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(335px, 1fr)); gap: 15px; padding-bottom: 56px; }
.card { background: var(--surface); border: 1px solid var(--line2); border-radius: 14px; padding: 19px; text-decoration: none; color: inherit; position: relative; overflow: hidden;
  transition: transform .22s cubic-bezier(.2,.7,.2,1), border-color .22s, box-shadow .22s; opacity: 0; transform: translateY(12px); }
.card.in { opacity: 1; transform: translateY(0); }
.card:hover { transform: translateY(-4px); border-color: var(--indigo); box-shadow: var(--shadow); }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card .rank { font-family: "Sora", sans-serif; font-weight: 700; font-size: 20px; color: var(--faint); }
.card .cat { font-size: 9.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--magenta); border: 1px solid color-mix(in srgb, var(--magenta) 35%, transparent); padding: 4px 8px; border-radius: 100px; }
.card .name { font-family: "Sora", sans-serif; font-weight: 700; font-size: 18px; letter-spacing: -.01em; line-height: 1.15; margin-top: 12px; }
.card .owner { font-size: 11px; color: var(--faint); margin-top: 3px; }
.card .desc { font-size: 13px; color: var(--muted); margin-top: 9px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.gauge { display: flex; align-items: center; gap: 10px; margin-top: 13px; }
.gauge .bar { flex: 1; height: 5px; background: var(--bg2); border-radius: 100px; overflow: hidden; }
.gauge .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--indigo), var(--magenta)); transition: width 1s cubic-bezier(.2,.7,.2,1); }
.gauge .score { font-family: "Sora", sans-serif; font-weight: 700; font-size: 14px; color: var(--indigo); width: 28px; text-align: right; }
.card-foot { display: flex; gap: 12px; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--faint); flex-wrap: wrap; }
.card-foot .lang::before { content: "● "; color: var(--magenta); }
.empty { grid-column: 1/-1; text-align: center; padding: 64px; color: var(--faint); }

footer { border-top: 1px solid var(--line2); padding: 34px 0 56px; margin-top: 18px; }
.foot-row { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
footer .blurb { max-width: 46ch; color: var(--muted); font-size: 13px; }
footer .links { display: flex; flex-direction: column; gap: 7px; }
footer .links a { color: var(--muted); text-decoration: none; font-size: 12px; transition: color .2s; }
footer .links a:hover { color: var(--indigo); }
.updated { font-size: 11px; color: var(--faint); margin-top: 22px; }

.detail { padding: 44px 0 40px; }
.crumb { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); margin-bottom: 22px; }
.crumb a { color: var(--muted); text-decoration: none; } .crumb a:hover { color: var(--indigo); }
.detail h1 { font-family: "Sora", sans-serif; font-weight: 700; font-size: clamp(30px, 5vw, 52px); line-height: 1.02; letter-spacing: -.02em; }
.detail .sub { color: var(--faint); margin-top: 10px; font-size: 13px; }
.detail .desc-big { font-size: clamp(16px, 2vw, 21px); color: var(--muted); margin-top: 22px; max-width: 62ch; }
.detail-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px,1fr)); gap: 10px; margin: 28px 0; }
.detail-stats .box { background: var(--surface); border: 1px solid var(--line2); border-radius: 12px; padding: 15px 17px; }
.detail-stats .num { font-family: "Sora", sans-serif; font-weight: 700; font-size: 26px; background: linear-gradient(120deg,var(--indigo),var(--magenta)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.detail-stats .lbl { font-size: 10px; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); margin-top: 6px; }
.topics { display: flex; gap: 7px; flex-wrap: wrap; margin: 20px 0; }
.topic { font-size: 11px; color: var(--muted); background: var(--surface); border: 1px solid var(--line2); padding: 5px 11px; border-radius: 100px; }
.cta { display: inline-flex; align-items: center; gap: 9px; background: linear-gradient(120deg,var(--indigo),var(--magenta)); color: #fff; text-decoration: none; padding: 13px 24px; border-radius: 10px; font-family: "Geist Mono", monospace; font-size: 13px; transition: transform .2s, box-shadow .2s; }
.cta:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.related { margin-top: 48px; padding-top: 26px; border-top: 1px solid var(--line); }
.related h2 { font-family: "Sora", sans-serif; font-weight: 700; font-size: 20px; margin-bottom: 16px; }

@media (max-width: 640px) { .wrap { padding: 0 16px; } .grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .card { opacity: 1; transform: none; transition: none; } .gauge .bar i { transition: none; } }

/* ── connective tissue (kstrip) + GEO about/faq — retrofit ── */
.kstrip { position: relative; z-index: 60; background: var(--ink); color: var(--bg);
  font-family: ui-monospace, "IBM Plex Mono", "Martian Mono", monospace; font-size: 10.5px; letter-spacing: .04em; }
.kstrip .wrap { display: flex; align-items: center; gap: 16px; padding: 7px 28px; flex-wrap: wrap; }
.kstrip a { color: var(--bg); text-decoration: none; opacity: .82; transition: opacity .2s; display: inline-flex; align-items: center; gap: 6px; }
.kstrip a:hover { opacity: 1; }
.kstrip .dot { width: 7px; height: 7px; background: var(--accent); border-radius: 1px; display: inline-block; }
.kstrip .sep { opacity: .3; }
.kstrip .grow { flex: 1; }
.about { border-top: 1px solid var(--line2); padding: 48px 0 8px; }
.about h2 { font-weight: 800; font-size: clamp(22px, 3vw, 30px); letter-spacing: -.02em; margin-bottom: 8px; }
.about .intro { color: var(--muted); max-width: 70ch; font-size: 14px; line-height: 1.7; margin-bottom: 28px; }
.faq { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.faq .q { background: var(--surface); border: 1px solid var(--line2); border-radius: 6px; padding: 20px 22px; }
.faq .q h3 { font-weight: 700; font-size: 15px; margin-bottom: 8px; color: var(--ink); }
.faq .q p { font-size: 12.5px; color: var(--muted); line-height: 1.65; }
@media (max-width: 640px) { .kstrip .wrap { padding: 7px 18px; } }
