/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg:        #0a1628;
  --bg2:       #0f1e35;
  --surface:   #141f33;
  --surface2:  #1a2740;
  --surface3:  #1e2e47;
  --border:    rgba(255,255,255,.08);
  --border2:   rgba(255,255,255,.13);
  --accent:    #3b82f6;
  --accent2:   #60a5fa;
  --grad:      linear-gradient(135deg, #3b82f6, #8b5cf6);
  --text:      #e2e8f0;
  --text-muted:#7c8fa6;
  --text-dim:  #4a5e78;
  --shadow:    0 4px 24px rgba(0,0,0,.35);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.5);
  --radius:    14px;
  --radius-sm: 8px;
  font-size: 16px;
}
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: var(--accent2); text-decoration: none; }
a:hover { color: var(--text); }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 3px; }

/* ── NAVBAR ── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(10,22,40,.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.navbar.scrolled { border-bottom-color: var(--border); }
.nav-inner {
  max-width: 1180px; margin: 0 auto;
  padding: 0 24px; height: 62px;
  display: flex; align-items: center; gap: 24px;
}
.nav-brand { display: flex; align-items: center; gap: 9px; color: var(--text); font-weight: 700; font-size: 15px; }
.brand-icon { font-size: 20px; }
.brand-market { color: var(--accent2); }
.nav-center { display: flex; align-items: center; gap: 4px; flex: 1; justify-content: center; }
.nav-link {
  padding: 6px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 500;
  color: var(--text-muted); transition: color .2s, background .2s;
}
.nav-link:hover { color: var(--text); background: var(--surface2); }
.nav-gh { display: flex; align-items: center; gap: 5px; }
.nav-auth { display: flex; align-items: center; }
.btn-login {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 15px; border-radius: 8px; border: 1px solid var(--border2);
  background: var(--surface2); color: var(--text); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background .2s, border-color .2s;
}
.btn-login:hover { background: var(--surface3); border-color: var(--accent); }
.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px; border-radius: 30px; background: var(--surface2);
  border: 1px solid var(--border2);
}
.user-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.user-name { font-size: 13px; font-weight: 600; color: var(--text); }
.user-logout {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 12px; padding: 2px 4px; border-radius: 4px;
}
.user-logout:hover { color: var(--text); }
.nav-toggle {
  display: none; flex-direction: column; gap: 5px; background: none;
  border: none; cursor: pointer; padding: 4px; margin-left: auto;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text-muted); border-radius: 2px; }

/* ── HERO ── */
.hero {
  padding: 140px 24px 80px;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(59,130,246,.12) 0%, transparent 70%);
  text-align: center;
}
.hero-inner { max-width: 780px; margin: 0 auto; }
.hero-badge {
  display: inline-block; padding: 6px 14px; border-radius: 20px;
  background: rgba(59,130,246,.12); border: 1px solid rgba(59,130,246,.25);
  font-size: 12.5px; font-weight: 500; color: var(--accent2);
  margin-bottom: 28px; letter-spacing: .02em;
}
.hero-badge a { color: inherit; text-decoration: underline; text-decoration-color: rgba(96,165,250,.4); }
.hero-title {
  font-size: clamp(38px, 6vw, 64px);
  font-weight: 900; line-height: 1.1; color: var(--text);
  letter-spacing: -.03em; margin-bottom: 20px;
}
.hero-grad {
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #ec4899 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub { font-size: 17px; color: var(--text-muted); line-height: 1.65; margin-bottom: 36px; }

/* ── SEARCH ── */
.search-wrap {
  position: relative; max-width: 600px; margin: 0 auto 36px;
}
.search-icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  font-size: 16px; pointer-events: none;
}
.search-input {
  width: 100%; padding: 14px 44px 14px 46px;
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 50px; color: var(--text); font-size: 15px;
  font-family: inherit; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.search-input::placeholder { color: var(--text-dim); }
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,.18);
}
.search-clear {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  background: var(--surface3); border: none; color: var(--text-muted); cursor: pointer;
  font-size: 12px; width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.search-clear:hover { color: var(--text); }

/* ── HERO STATS ── */
.hero-stats {
  display: flex; align-items: center; justify-content: center; gap: 0; flex-wrap: wrap;
}
.h-stat { padding: 0 28px; text-align: center; }
.h-stat-n { display: block; font-size: 26px; font-weight: 800; color: var(--text); }
.h-stat-l { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
.h-stat-div { width: 1px; height: 36px; background: var(--border); }

/* ── CATEGORY CHIPS ── */
.cats-bar { border-bottom: 1px solid var(--border); background: var(--bg2); position: sticky; top: 62px; z-index: 90; }
.cats {
  max-width: 1180px; margin: 0 auto; padding: 12px 24px;
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
}
.cats::-webkit-scrollbar { display: none; }
.cat-chip {
  padding: 6px 16px; border-radius: 20px; border: 1px solid var(--border);
  background: transparent; color: var(--text-muted); font-size: 13px; font-weight: 500;
  cursor: pointer; white-space: nowrap; transition: all .2s;
}
.cat-chip:hover { color: var(--text); border-color: var(--border2); background: var(--surface2); }
.cat-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

/* ── SKILLS GRID ── */
.main { max-width: 1180px; margin: 0 auto; padding: 40px 24px 80px; }
.skills-header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 24px; }
.skills-h { font-size: 20px; font-weight: 700; }
.skills-count { font-size: 13px; color: var(--text-muted); }
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.no-results {
  padding: 80px 20px; text-align: center; color: var(--text-muted);
  flex-direction: column; align-items: center; gap: 8px;
  display: flex;
}
.no-results a { color: var(--accent2); }

/* ── SKILL CARD ── */
.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  display: flex; flex-direction: column; gap: 14px;
  position: relative; overflow: hidden;
}
.skill-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--card-color, var(--accent));
  border-radius: var(--radius) var(--radius) 0 0;
}
.skill-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border2);
}
.skill-card-top { display: flex; align-items: flex-start; gap: 14px; }
.skill-emoji-wrap {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--surface2); display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex-shrink: 0;
}
.skill-info { flex: 1; min-width: 0; }
.skill-name { font-size: 15px; font-weight: 700; color: var(--text); }
.skill-fullname { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.skill-author {
  display: flex; align-items: center; gap: 5px; margin-top: 4px;
  font-size: 12px; color: var(--text-muted);
}
.skill-author-img { width: 16px; height: 16px; border-radius: 50%; object-fit: cover; }
.skill-featured {
  padding: 3px 8px; border-radius: 6px;
  background: rgba(59,130,246,.15); color: var(--accent2);
  font-size: 11px; font-weight: 600; letter-spacing: .04em;
  white-space: nowrap; flex-shrink: 0;
}
.skill-desc { font-size: 13.5px; color: var(--text-muted); line-height: 1.6; flex: 1; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.skill-tag {
  padding: 3px 9px; border-radius: 12px;
  background: var(--surface2); border: 1px solid var(--border);
  font-size: 11px; font-weight: 500; color: var(--text-muted);
}
.skill-card-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 4px;
}
.skill-foot-stats { display: flex; gap: 8px; align-items: center; }
.skill-foot-stat { font-size: 12.5px; color: var(--text-muted); }
.star-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: none; border: 1px solid #f59e0b;
  border-radius: 20px; padding: 3px 10px;
  font-size: 12.5px; color: #f59e0b;
  cursor: pointer; transition: all .18s ease; line-height: 1;
}
.star-btn:hover { background: rgba(245,158,11,.12); }
.star-btn.starred { background: rgba(245,158,11,.18); }
.star-btn .star-icon { font-size: 13px; }
.star-btn.starred .star-icon { animation: star-pop .22s ease; }
@keyframes star-pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.5); }
  100% { transform: scale(1); }
}
.btn-install {
  padding: 7px 18px; border-radius: 8px; border: none;
  background: var(--accent); color: #fff; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background .2s, transform .1s;
}
.btn-install:hover { background: #2563eb; }
.btn-install:active { transform: scale(.97); }
.btn-install:disabled { opacity: .7; cursor: not-allowed; }

/* ── CONTRIBUTORS ── */
.contrib-section { background: var(--bg2); border-top: 1px solid var(--border); padding: 80px 24px; }
.section-wrap { max-width: 1180px; margin: 0 auto; }
.section-hd { text-align: center; margin-bottom: 40px; }
.section-title { font-size: 28px; font-weight: 800; margin-bottom: 8px; }
.section-sub { color: var(--text-muted); font-size: 15px; }
.contrib-grid {
  display: flex; flex-wrap: wrap; gap: 16px; justify-content: center;
}
.contrib-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 24px 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  width: 130px; transition: transform .2s, border-color .2s;
}
.contrib-card:hover { transform: translateY(-2px); border-color: var(--border2); }
.contrib-avatar { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; }
.contrib-name { font-size: 12.5px; font-weight: 600; color: var(--text); text-align: center; }
.contrib-skills { font-size: 11.5px; color: var(--text-muted); }
.contrib-star { font-size: 13px; color: #f59e0b; font-weight: 700; }
.contrib-specialty { font-size: 10.5px; color: var(--text-muted); text-align: center; line-height: 1.4; padding: 0 4px; margin-top: 1px; }

/* ── CONTRIBUTE CTA ── */
.cta-section { padding: 100px 24px; text-align: center; }
.cta-badge {
  display: inline-block; padding: 5px 14px; border-radius: 20px;
  background: rgba(16,185,129,.12); border: 1px solid rgba(16,185,129,.25);
  font-size: 12px; font-weight: 600; color: #10b981; margin-bottom: 20px;
}
.cta-title { font-size: clamp(26px, 4vw, 42px); font-weight: 900; margin-bottom: 14px; }
.cta-sub { color: var(--text-muted); font-size: 16px; margin-bottom: 52px; }

.steps { display: flex; align-items: center; justify-content: center; gap: 0; flex-wrap: wrap; margin-bottom: 48px; }
.step-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 24px; width: 220px;
  text-align: center; position: relative;
}
.step-num {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.step-icon { font-size: 28px; margin-bottom: 10px; }
.step-card strong { display: block; font-size: 14px; color: var(--text); margin-bottom: 6px; }
.step-card p { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }
.step-arrow { font-size: 20px; color: var(--text-dim); padding: 0 8px; }

.cta-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-cta-primary {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 26px; border-radius: 10px; border: none;
  background: var(--text); color: var(--bg); font-size: 14px; font-weight: 700;
  cursor: pointer; transition: opacity .2s;
}
.btn-cta-primary:hover { opacity: .88; color: var(--bg); }
.btn-cta-outline {
  padding: 13px 26px; border-radius: 10px; border: 1px solid var(--border2);
  color: var(--text); font-size: 14px; font-weight: 600;
  transition: background .2s;
}
.btn-cta-outline:hover { background: var(--surface2); color: var(--text); }

/* ── FOOTER ── */
.footer { border-top: 1px solid var(--border); padding: 28px 24px; }
.footer-inner {
  max-width: 1180px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.footer-brand { font-size: 13.5px; color: var(--text-muted); }
.footer-links { display: flex; gap: 20px; }
.footer-links a { font-size: 13px; color: var(--text-muted); transition: color .2s; }
.footer-links a:hover { color: var(--text); }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.7); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: 18px; max-width: 580px; width: 100%;
  max-height: 88vh; overflow-y: auto; position: relative;
  box-shadow: var(--shadow-lg);
  transform: scale(.96); transition: transform .25s;
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-close {
  position: absolute; top: 14px; right: 14px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text-muted); width: 30px; height: 30px; border-radius: 8px;
  font-size: 13px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  z-index: 1;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 28px; }
.modal-hd { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.modal-emoji-wrap {
  width: 60px; height: 60px; border-radius: 14px;
  background: var(--surface2); display: flex; align-items: center; justify-content: center;
  font-size: 30px; flex-shrink: 0;
}
.modal-title { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.modal-author {
  font-size: 13px; color: var(--text-muted);
  display: flex; align-items: center; gap: 6px;
}
.modal-author-img { width: 20px; height: 20px; border-radius: 50%; }
.modal-desc { font-size: 14.5px; color: var(--text-muted); line-height: 1.7; margin-bottom: 18px; }
.modal-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.modal-stats {
  display: flex; gap: 0; border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; margin-bottom: 24px;
}
.modal-stat {
  flex: 1; padding: 14px; text-align: center; border-right: 1px solid var(--border);
}
.modal-stat:last-child { border-right: none; }
.modal-stat strong { display: block; font-size: 20px; font-weight: 800; }
.modal-stat span { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.modal-install-section { display: flex; flex-direction: column; gap: 14px; }
.install-step { background: var(--surface2); border-radius: 10px; padding: 14px 16px; }
.install-step-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.install-cmd {
  display: block; background: var(--bg); border-radius: 6px;
  padding: 10px 12px; font-family: 'SF Mono', 'Fira Code', monospace; font-size: 12.5px;
  color: var(--accent2); overflow-x: auto; white-space: nowrap;
  border: 1px solid var(--border);
}
.btn-install-modal {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: 8px; border: none;
  background: var(--accent); color: #fff; font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: background .2s; margin-top: 8px;
}
.btn-install-modal:hover { background: #2563eb; }
.btn-install-modal:disabled { opacity: .7; cursor: not-allowed; }
.modal-footer-link { margin-top: 16px; text-align: right; }
.modal-footer-link a { font-size: 13px; color: var(--text-muted); }
.modal-footer-link a:hover { color: var(--accent2); }

/* ── DEVICE FLOW MODAL ── */
.device-modal { max-width: 400px; }
.device-code {
  font-size: 32px; font-weight: 900; letter-spacing: 0.15em;
  color: var(--text); background: var(--surface2);
  border: 2px solid var(--accent); border-radius: 12px;
  padding: 16px 24px; margin: 16px 0; font-family: 'SF Mono', monospace;
  user-select: all; cursor: pointer;
}
.btn-device-open {
  display: block; width: 100%; padding: 12px;
  border-radius: 8px; border: none;
  background: var(--text); color: var(--bg);
  font-size: 14px; font-weight: 700; text-align: center;
  margin-bottom: 16px; transition: opacity .2s;
}
.btn-device-open:hover { opacity: .85; color: var(--bg); }
.device-waiting {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 13px; color: var(--text-muted); margin-bottom: 8px;
}
.device-spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--border2); border-top-color: var(--accent);
  animation: spin .8s linear infinite; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.device-countdown { font-size: 12px; color: var(--text-dim); text-align: center; }

/* ── AUTH MODAL ── */
.auth-modal { max-width: 380px; }
.auth-modal-body { padding: 32px 28px; text-align: center; }
.auth-modal-body h3 { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.auth-modal-body p { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }
.gh-input {
  width: 100%; padding: 11px 14px; border-radius: 8px;
  background: var(--surface2); border: 1px solid var(--border2);
  color: var(--text); font-size: 14px; font-family: inherit; outline: none;
  margin-bottom: 8px;
}
.gh-input:focus { border-color: var(--accent); }
.auth-error { font-size: 12.5px; color: #f87171; margin-bottom: 12px; }
.btn-auth-submit {
  width: 100%; padding: 11px; border-radius: 8px; border: none;
  background: var(--text); color: var(--bg); font-size: 14px; font-weight: 700;
  cursor: pointer; transition: opacity .2s;
}
.btn-auth-submit:hover { opacity: .85; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .nav-center { display: none; }
  .nav-toggle { display: flex; }
  .nav-center.open {
    display: flex; flex-direction: column; position: fixed;
    top: 62px; left: 0; right: 0;
    background: var(--bg2); border-bottom: 1px solid var(--border);
    padding: 16px 24px; gap: 4px;
  }
  .hero { padding: 110px 20px 60px; }
  .hero-title { font-size: 38px; }
  .h-stat { padding: 0 16px; }
  .skills-grid { grid-template-columns: 1fr; }
  .steps { flex-direction: column; align-items: center; }
  .step-arrow { transform: rotate(90deg); }
  .footer-inner { flex-direction: column; text-align: center; }
}
