/* =========================================================
   kcolbchain directory — Stylesheet
   ========================================================= */

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

:root {
  --bg:       #0a0a0f;
  --bg-card:  #12121a;
  --bg-hover: #1a1a26;
  --border:   #1e1e2e;
  --text:     #e0e0e8;
  --text-dim: #8888a0;
  --accent:   #4e8cff;
  --accent-2: #6ee7b7;
  --white:    #f5f5fa;
  --radius:   8px;
  --max-w:    1200px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent-2); }
img { max-width: 100%; display: block; }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.dot { color: var(--text-dim); margin: 0 6px; }
.page { min-height: 100vh; }

/* --- Topbar --- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10, 10, 15, .9);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; height: 56px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--white); font-weight: 700; font-size: .95rem; }
.brand:hover { color: var(--white); }
.brand-mark { height: 28px; width: auto; border-radius: 4px; }
.brand-sub { color: var(--accent); font-weight: 500; }
.nav { display: flex; gap: 4px; }
.nav-link {
  color: var(--text-dim); font-size: .8rem; font-weight: 500;
  padding: 6px 12px; border-radius: var(--radius); transition: all .15s;
}
.nav-link:hover, .nav-link.active { color: var(--white); background: var(--bg-hover); }

/* --- Hero --- */
.hero { padding: 72px 0 32px; }
.kicker {
  font-size: .75rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .12em; color: var(--accent); margin-bottom: 12px;
}
.hero-title {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem); font-weight: 800;
  line-height: 1.15; color: var(--white); letter-spacing: -0.03em; margin-bottom: 16px;
}
.hero-subtitle { font-size: .95rem; color: var(--text-dim); line-height: 1.65; max-width: 600px; margin-bottom: 28px; }

/* Search */
.search-wrap { position: relative; max-width: 520px; margin-bottom: 20px; }
.search-input {
  width: 100%; padding: 12px 16px; padding-right: 80px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--white); font-size: .9rem; font-family: inherit;
  outline: none; transition: border-color .15s;
}
.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--text-dim); }
.search-count {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  font-size: .75rem; color: var(--text-dim); font-family: 'JetBrains Mono', monospace;
}

/* Tag cloud */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tag {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px;
  padding: 4px 12px; font-size: .7rem; font-weight: 500; color: var(--text-dim);
  cursor: pointer; transition: all .15s; font-family: inherit;
}
.tag:hover { border-color: var(--accent); color: var(--white); }
.tag.active { background: var(--accent); border-color: var(--accent); color: var(--bg); }

/* --- Signup bar --- */
.signup-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 20px; margin-bottom: 16px;
}
.signup-text { font-size: .85rem; color: var(--text-dim); }
.signup-text strong { color: var(--white); }
.signup-form { display: flex; gap: 8px; flex-shrink: 0; }
.signup-email {
  padding: 8px 14px; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--white); font-size: .85rem;
  font-family: inherit; outline: none; width: 220px;
}
.signup-email:focus { border-color: var(--accent); }
.signup-email::placeholder { color: var(--text-dim); }
.signup-btn { padding: 8px 18px; font-size: .8rem; }

/* Meta bar */
.meta-bar {
  font-size: .75rem; color: var(--text-dim); margin-bottom: 8px;
}
.meta-bar a { color: var(--text-dim); }
.meta-bar a:hover { color: var(--accent); }
.meta-updated {
  font-family: 'JetBrains Mono', monospace;
  background: rgba(110, 231, 183, .1); color: var(--accent-2);
  padding: 2px 8px; border-radius: 4px; font-size: .7rem;
}

@media (max-width: 768px) {
  .signup-bar { flex-direction: column; align-items: stretch; }
  .signup-form { width: 100%; }
  .signup-email { flex: 1; width: auto; }
}

/* --- Sections --- */
.section { padding: 48px 0; }
.section-head { margin-bottom: 32px; }
.section-head h2 {
  font-size: 1.6rem; font-weight: 800; color: var(--white);
  letter-spacing: -0.02em; margin-bottom: 6px;
}
.section-head p { color: var(--text-dim); font-size: .9rem; }

.cat-title {
  font-size: .7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .1em; color: var(--text-dim); margin-bottom: 14px; margin-top: 32px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.cat-title:first-of-type { margin-top: 0; }

/* --- Grid --- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-bottom: 24px; }

/* --- Cards --- */
.card {
  display: block; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; transition: border-color .2s, transform .15s;
  color: var(--text);
}
.card:hover { border-color: var(--accent); transform: translateY(-1px); color: var(--text); }

.card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.card-name {
  font-family: 'JetBrains Mono', monospace; font-weight: 700;
  font-size: .85rem; color: var(--white);
}
.card-lang, .card-year {
  font-size: .7rem; color: var(--text-dim); font-family: 'JetBrains Mono', monospace;
  background: rgba(255,255,255,.05); padding: 2px 8px; border-radius: 4px;
}
.card p { font-size: .8rem; color: var(--text-dim); line-height: 1.55; }
.card-meta { margin-top: 10px; }
.card-org { font-size: .7rem; color: var(--accent); font-weight: 500; }

.card-icon { font-size: 1.4rem; margin-bottom: 10px; }
.card h3 { font-size: .9rem; font-weight: 700; color: var(--white); margin-bottom: 8px; }

/* Paper cards */
.card.paper { border-left: 3px solid var(--accent); }

/* --- Buttons --- */
.button {
  display: inline-flex; align-items: center; padding: 10px 20px;
  font-size: .85rem; font-weight: 600; border-radius: var(--radius);
  border: 1px solid var(--border); color: var(--text); background: transparent;
  cursor: pointer; transition: all .15s;
}
.button:hover { border-color: var(--text-dim); color: var(--white); background: var(--bg-hover); }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.button.primary:hover { background: #3a78eb; color: #fff; }

/* --- CTA Section --- */
.cta-section { padding: 64px 0; background: linear-gradient(180deg, var(--bg) 0%, #0d0d18 100%); }
.cta-inner { text-align: center; }
.cta-inner h2 { font-size: 1.4rem; font-weight: 800; color: var(--white); margin-bottom: 10px; }
.cta-inner p { color: var(--text-dim); margin-bottom: 20px; max-width: 480px; margin-left: auto; margin-right: auto; }
.cta-actions { display: flex; gap: 12px; justify-content: center; }

/* --- Footer --- */
.footer { border-top: 1px solid var(--border); padding: 28px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; }
.footer-brand { font-weight: 700; color: var(--white); font-size: .85rem; margin-bottom: 2px; }
.footer-meta { font-size: .72rem; color: var(--text-dim); }
.footer-right { font-size: .75rem; color: var(--text-dim); }
.footer-right a { color: var(--text-dim); }
.footer-right a:hover { color: var(--accent); }

/* --- Responsive --- */
@media (max-width: 768px) {
  .hero { padding: 48px 0 24px; }
  .hero-title { font-size: 1.6rem; }
  .grid { grid-template-columns: 1fr; }
  .nav { display: none; }
  .topbar-inner { height: 48px; }
  .footer-inner { flex-direction: column; gap: 8px; text-align: center; }
  .cta-actions { flex-direction: column; align-items: center; }
}
