/* ============================================================
   AI SKILL BANK — style.css
   Dark developer-registry aesthetic: charcoal near-black,
   phosphor-green accents, amber highlights, monospace everywhere.
   ============================================================ */

:root {
  --bg:        #0b0d0e;
  --bg-soft:   #111415;
  --bg-raise:  #16191b;
  --bg-line:   #232728;
  --ink:       #d7dcd4;
  --ink-dim:   #9aa19a;
  --ink-faint: #6b726b;
  --green:     #4ade80;
  --green-dim: #22c55e;
  --green-glow: rgba(74, 222, 128, .12);
  --amber:     #fbbf24;
  --amber-glow: rgba(251, 191, 36, .10);
  --red:       #f87171;
  --blue:      #60a5fa;
  --mono: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius: 10px;
  --maxw: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* subtle scanline/grid texture behind everything */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(74,222,128,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74,222,128,.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, black 30%, transparent 100%);
}

::selection { background: var(--green-dim); color: #04140a; }

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

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); letter-spacing: -.01em; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; }
.mono, code, kbd, pre, tt { font-family: var(--mono); }
code {
  background: var(--bg-raise);
  border: 1px solid var(--bg-line);
  border-radius: 5px;
  padding: .12em .42em;
  font-size: .88em;
  color: var(--green);
  white-space: nowrap;
}
pre {
  background: #0e1110;
  border: 1px solid var(--bg-line);
  border-left: 3px solid var(--green-dim);
  border-radius: 8px;
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  font-size: .85rem;
  line-height: 1.6;
  color: #c9d4c5;
}
pre .prompt { color: var(--green-dim); user-select: none; }
pre .comment { color: var(--ink-faint); }

/* ---------- layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }
.page-head { padding: 3.5rem 0 2rem; }
.page-head h1 .accent { color: var(--green); }
.lede { color: var(--ink-dim); font-size: 1.1rem; max-width: 62ch; }
section.block { padding: 2.75rem 0; }
section.block + section.block { border-top: 1px dashed var(--bg-line); }

/* ---------- header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 13, 14, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--bg-line);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem;
  display: flex; align-items: center; gap: 1.5rem; height: 62px;
}
.brand { display: flex; align-items: center; gap: .6rem; font-family: var(--mono); font-weight: 700; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .logo { width: 30px; height: 30px; flex: none; }
.brand .logo-b { color: var(--green); }
.nav-links { display: flex; gap: .25rem; margin-left: auto; }
.nav-links a {
  color: var(--ink-dim); font-family: var(--mono); font-size: .83rem;
  padding: .45rem .7rem; border-radius: 6px; white-space: nowrap;
}
.nav-links a:hover { color: var(--green); background: var(--green-glow); text-decoration: none; }
.nav-links a.active { color: var(--green); background: var(--green-glow); }
.nav-cta {
  font-family: var(--mono); font-size: .8rem; font-weight: 700;
  background: var(--green); color: #04140a !important;
  padding: .5rem .9rem; border-radius: 6px;
}
.nav-cta:hover { background: #86efac; text-decoration: none; }

/* ---------- hero ---------- */
.hero { padding: 4.5rem 0 3rem; position: relative; }
.hero .kicker {
  font-family: var(--mono); font-size: .8rem; letter-spacing: .18em;
  color: var(--amber); text-transform: uppercase; margin-bottom: 1rem;
}
.hero h1 { max-width: 18ch; }
.hero h1 .accent { color: var(--green); text-shadow: 0 0 28px rgba(74,222,128,.35); }
.hero .lede { font-size: 1.15rem; }
.hero-actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.6rem; }

.btn {
  display: inline-block; font-family: var(--mono); font-weight: 700; font-size: .9rem;
  padding: .75rem 1.35rem; border-radius: 8px; border: 1px solid transparent;
  cursor: pointer; transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--green); color: #04140a; box-shadow: 0 0 24px rgba(74,222,128,.25); }
.btn-primary:hover { background: #86efac; }
.btn-ghost { border-color: var(--bg-line); color: var(--ink); background: var(--bg-soft); }
.btn-ghost:hover { border-color: var(--green-dim); color: var(--green); }

.terminal {
  margin-top: 2.5rem; max-width: 640px;
  background: #0d100e; border: 1px solid var(--bg-line); border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
  overflow: hidden;
}
.terminal-bar {
  display: flex; align-items: center; gap: .45rem;
  padding: .7rem 1rem; background: var(--bg-raise); border-bottom: 1px solid var(--bg-line);
  font-family: var(--mono); font-size: .75rem; color: var(--ink-faint);
}
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot.r { background: #f87171; } .dot.y { background: #fbbf24; } .dot.g { background: #4ade80; }
.terminal pre { border: none; border-radius: 0; margin: 0; background: transparent; }

/* ---------- search ---------- */
.search-shell { position: relative; max-width: 640px; margin-top: 2rem; }
.search-shell input {
  width: 100%; font-family: var(--mono); font-size: 1rem;
  background: var(--bg-soft); color: var(--ink);
  border: 1px solid var(--bg-line); border-radius: 10px;
  padding: .9rem 1.1rem .9rem 2.9rem;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.search-shell input:focus { border-color: var(--green-dim); box-shadow: 0 0 0 3px var(--green-glow); }
.search-shell .icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--ink-faint); }
.search-results {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px);
  background: var(--bg-raise); border: 1px solid var(--bg-line); border-radius: 10px;
  overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,.55); display: none;
}
.search-results.open { display: block; }
.search-results a {
  display: flex; align-items: center; gap: .7rem; padding: .7rem 1rem;
  color: var(--ink); border-bottom: 1px solid var(--bg-line);
}
.search-results a:last-child { border-bottom: none; }
.search-results a:hover { background: var(--green-glow); text-decoration: none; }
.search-results .sr-name { font-family: var(--mono); font-size: .9rem; color: var(--green); }
.search-results .sr-desc { font-size: .8rem; color: var(--ink-faint); margin-left: auto; text-align: right; max-width: 55%; }

/* ---------- value props ---------- */
.props { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.1rem; margin-top: 1.5rem; }
.prop {
  background: var(--bg-soft); border: 1px solid var(--bg-line); border-radius: var(--radius);
  padding: 1.4rem 1.3rem;
}
.prop:hover { border-color: var(--green-dim); }
.prop .glyph {
  font-family: var(--mono); font-size: 1.3rem; color: var(--green);
  width: 44px; height: 44px; display: grid; place-items: center;
  background: var(--green-glow); border-radius: 8px; margin-bottom: .9rem;
}
.prop h3 { font-family: var(--mono); font-size: .95rem; margin-bottom: .5rem; }
.prop p { color: var(--ink-dim); font-size: .92rem; margin: 0; }

/* ---------- skill cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.1rem; margin-top: 1.5rem; }
.card {
  background: var(--bg-soft); border: 1px solid var(--bg-line); border-radius: var(--radius);
  padding: 1.35rem 1.3rem; display: flex; flex-direction: column; gap: .7rem;
  transition: border-color .15s, transform .12s;
}
.card:hover { border-color: var(--green-dim); transform: translateY(-2px); }
.card-top { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.card-name { font-family: var(--mono); font-weight: 700; font-size: 1.02rem; color: var(--ink); margin: 0; }
.card-name a { color: inherit; }
.card-name a:hover { color: var(--green); text-decoration: none; }
.card-desc { color: var(--ink-dim); font-size: .92rem; margin: 0; flex: 1; }
.card-foot { display: flex; align-items: center; gap: .6rem; margin-top: auto; padding-top: .4rem; }
.card-foot .spacer { flex: 1; }
.changelog-link { font-family: var(--mono); font-size: .78rem; color: var(--ink-faint); }
.changelog-link:hover { color: var(--amber); }

.chip {
  display: inline-block; font-family: var(--mono); font-size: .72rem; font-weight: 700;
  padding: .16rem .55rem; border-radius: 999px; border: 1px solid var(--bg-line);
  background: var(--bg-raise); color: var(--ink-dim); white-space: nowrap;
}
.chip.ver { background: var(--green-glow); border-color: rgba(74,222,128,.35); color: var(--green); }
.chip.mcp { background: var(--amber-glow); border-color: rgba(251,191,36,.35); color: var(--amber); }
.chip.cat { color: var(--ink-faint); }
.chip.lic { color: var(--blue); border-color: rgba(96,165,250,.3); background: rgba(96,165,250,.08); }

/* ---------- filters ---------- */
.toolbar {
  display: flex; gap: .7rem; flex-wrap: wrap; align-items: center;
  margin: 1.8rem 0 0; padding: 1rem; background: var(--bg-soft);
  border: 1px solid var(--bg-line); border-radius: var(--radius);
}
.toolbar input[type="search"], .toolbar select {
  font-family: var(--mono); font-size: .85rem;
  background: var(--bg); color: var(--ink); border: 1px solid var(--bg-line);
  border-radius: 7px; padding: .55rem .75rem; outline: none;
}
.toolbar input[type="search"] { flex: 1 1 220px; }
.toolbar input[type="search"]:focus, .toolbar select:focus { border-color: var(--green-dim); }
.toolbar label { font-family: var(--mono); font-size: .75rem; color: var(--ink-faint); }
.result-meta { font-family: var(--mono); font-size: .8rem; color: var(--ink-faint); margin: 1rem 0 0; }
.result-meta b { color: var(--green); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin-top: 1.5rem; border: 1px solid var(--bg-line); border-radius: var(--radius); }
table.registry { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 640px; }
table.registry thead th {
  font-family: var(--mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink-faint); text-align: left; padding: .8rem 1rem;
  background: var(--bg-raise); border-bottom: 1px solid var(--bg-line); white-space: nowrap;
}
table.registry tbody td { padding: .85rem 1rem; border-bottom: 1px solid var(--bg-line); vertical-align: top; }
table.registry tbody tr:last-child td { border-bottom: none; }
table.registry tbody tr:hover { background: rgba(74,222,128,.04); }
table.registry td.name { font-family: var(--mono); font-weight: 700; white-space: nowrap; }
table.registry td.desc { color: var(--ink-dim); min-width: 260px; }
table.api { width: 100%; border-collapse: collapse; font-size: .88rem; margin-top: 1rem; }
table.api th, table.api td { text-align: left; padding: .7rem .9rem; border: 1px solid var(--bg-line); vertical-align: top; }
table.api th { font-family: var(--mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); background: var(--bg-raise); }
table.api td code { white-space: nowrap; }

/* ---------- changelog timeline ---------- */
.timeline { margin: 1.5rem 0 0; padding: 0; list-style: none; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 8px; top: 8px; bottom: 8px; width: 2px;
  background: var(--bg-line);
}
.timeline li { position: relative; padding: 0 0 1.6rem 2.4rem; }
.timeline li:last-child { padding-bottom: 0; }
.timeline .node {
  position: absolute; left: 2px; top: 5px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--green-dim);
}
.timeline .vhead { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin-bottom: .35rem; }
.timeline .vdate { font-family: var(--mono); font-size: .75rem; color: var(--ink-faint); }
.timeline ul.changes { margin: .4rem 0 0; padding-left: 1.1rem; color: var(--ink-dim); font-size: .92rem; }
.timeline ul.changes li { padding: 0 0 .3rem; }
.timeline ul.changes li::marker { color: var(--green-dim); }

/* ---------- docs ---------- */
.doc-grid { display: grid; grid-template-columns: 240px 1fr; gap: 2.5rem; margin-top: 2rem; align-items: start; }
.toc {
  position: sticky; top: 84px; background: var(--bg-soft);
  border: 1px solid var(--bg-line); border-radius: var(--radius); padding: 1.1rem 1.2rem;
}
.toc h4 { font-family: var(--mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-faint); margin: 0 0 .7rem; }
.toc a { display: block; font-size: .88rem; color: var(--ink-dim); padding: .28rem 0; }
.toc a:hover { color: var(--green); text-decoration: none; }
.doc h3 { font-family: var(--mono); font-size: 1.05rem; color: var(--green); margin-top: 2.2rem; scroll-margin-top: 90px; }
.doc h3:first-child { margin-top: 0; }
.doc p, .doc li { color: var(--ink-dim); }
.doc ul { padding-left: 1.2rem; }
.doc li { margin-bottom: .45rem; }
.callout {
  border: 1px solid rgba(251,191,36,.35); background: var(--amber-glow);
  border-radius: 8px; padding: 1rem 1.2rem; margin: 1.2rem 0; font-size: .93rem; color: var(--ink);
}
.callout.green { border-color: rgba(74,222,128,.35); background: var(--green-glow); }
.callout .tag { font-family: var(--mono); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--amber); display: block; margin-bottom: .3rem; }
.callout.green .tag { color: var(--green); }

/* ---------- forms ---------- */
.form-card {
  background: var(--bg-soft); border: 1px solid var(--bg-line); border-radius: var(--radius);
  padding: 1.8rem; margin-top: 1.5rem; max-width: 720px;
}
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-family: var(--mono); font-size: .8rem; color: var(--ink-dim); margin-bottom: .4rem; }
.field input, .field select, .field textarea {
  width: 100%; font-family: var(--mono); font-size: .9rem;
  background: var(--bg); color: var(--ink); border: 1px solid var(--bg-line);
  border-radius: 7px; padding: .65rem .8rem; outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green-dim); box-shadow: 0 0 0 3px var(--green-glow); }
.field textarea { min-height: 110px; resize: vertical; }
.field .hint { font-size: .78rem; color: var(--ink-faint); margin-top: .3rem; }
.checklist { list-style: none; padding: 0; margin: 1.2rem 0; }
.checklist li {
  display: flex; gap: .7rem; align-items: flex-start; padding: .55rem 0;
  border-bottom: 1px dashed var(--bg-line); color: var(--ink-dim); font-size: .93rem;
}
.checklist li:last-child { border-bottom: none; }
.checklist .box { color: var(--green); font-family: var(--mono); flex: none; }
.form-confirm {
  display: none; margin-top: 1.2rem; padding: 1rem 1.2rem;
  border: 1px solid rgba(74,222,128,.4); background: var(--green-glow); border-radius: 8px;
  font-family: var(--mono); font-size: .88rem; color: var(--green);
}
.form-confirm.show { display: block; }

/* ---------- steps (how submission works) ---------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.1rem; margin-top: 1.5rem; counter-reset: step; }
.step {
  background: var(--bg-soft); border: 1px solid var(--bg-line); border-radius: var(--radius);
  padding: 1.4rem 1.3rem; position: relative;
}
.step::before {
  counter-increment: step; content: "0" counter(step);
  font-family: var(--mono); font-size: 1.8rem; font-weight: 700; color: var(--green-dim);
  opacity: .55; display: block; margin-bottom: .6rem;
}
.step h3 { font-family: var(--mono); font-size: .95rem; margin-bottom: .5rem; }
.step p { color: var(--ink-dim); font-size: .9rem; margin: 0; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--bg-line); margin-top: 4rem; background: var(--bg-soft); }
.footer-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 2.5rem 1.25rem;
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem;
}
.footer-inner h4 { font-family: var(--mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-faint); margin-bottom: .8rem; }
.footer-inner a { display: block; color: var(--ink-dim); font-size: .88rem; padding: .22rem 0; }
.footer-inner a:hover { color: var(--green); }
.footer-brand { font-family: var(--mono); font-weight: 700; color: var(--ink); margin-bottom: .6rem; }
.footer-brand .logo-b { color: var(--green); }
.footer-note { font-size: .85rem; color: var(--ink-faint); max-width: 34ch; }
.footer-base {
  max-width: var(--maxw); margin: 0 auto; padding: 1.2rem 1.25rem;
  border-top: 1px solid var(--bg-line);
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-family: var(--mono); font-size: .75rem; color: var(--ink-faint);
}

/* ---------- misc ---------- */
.kv { display: grid; grid-template-columns: 160px 1fr; gap: .4rem 1rem; margin: 1.2rem 0; font-size: .92rem; }
.kv dt { font-family: var(--mono); color: var(--ink-faint); font-size: .8rem; }
.kv dd { margin: 0; color: var(--ink); }
.pill-row { display: flex; gap: .5rem; flex-wrap: wrap; margin: .6rem 0; }
.divider { border: none; border-top: 1px dashed var(--bg-line); margin: 2rem 0; }
.breadcrumb { font-family: var(--mono); font-size: .8rem; color: var(--ink-faint); margin-bottom: 1rem; }
.breadcrumb a { color: var(--ink-dim); }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .doc-grid { grid-template-columns: 1fr; }
  .toc { position: static; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .nav-links a:not(.nav-cta) { display: none; }
}
@media (max-width: 560px) {
  .footer-inner { grid-template-columns: 1fr; }
  .hero { padding: 3rem 0 2rem; }
  .kv { grid-template-columns: 1fr; }
}
