/* ═══════════════════════════════════════════════════
   SKILL NA VEIA — Design System (Claude vibes)
   ═══════════════════════════════════════════════════ */

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

:root {
  --background: #f5f5f0;
  --foreground: #1a1915;
  --primary: #c97856;
  --primary-hover: #b86a4a;
  --primary-foreground: #fff;
  --muted: #e8e4de;
  --muted-foreground: #6b6860;
  --border: #d4d0c8;
  --card: #fff;
  --card-foreground: #1a1915;
  --radius: 0.75rem;
  --success: #4a7c59;
  --error: #c44545;
  --info: #4a6b8a;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background-color: var(--background);
  color: var(--foreground);
  font-family: 'Geist', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.mono { font-family: 'Geist Mono', 'Courier New', monospace; }

/* ── Header ── */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--background);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1.5rem;
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.logo {
  font-family: 'Geist Mono', monospace;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -0.02em;
  color: var(--foreground);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
}
.logo-mark {
  display: inline-flex;
  width: 26px; height: 26px;
  background: var(--primary);
  border-radius: 6px;
  align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 0.85rem;
}
.logo-skill { color: var(--primary); }

.header-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}
.header-search input {
  width: 100%;
  padding: 0.55rem 0.85rem 0.55rem 2.25rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--foreground);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.header-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(201,120,86,0.15);
}
.header-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-foreground);
  pointer-events: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--foreground);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted-foreground);
}
.btn-ghost:hover { background: var(--muted); color: var(--foreground); }

.btn-block { width: 100%; padding: 0.95rem 1rem; font-size: 0.9rem; }

/* ── Layout ── */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

main { padding: 3rem 0 5rem; }

/* ── Hero (marketplace) ── */
.hero {
  text-align: center;
  padding: 3.5rem 1.5rem 4rem;
  max-width: 760px;
  margin: 0 auto;
}
.hero-eyebrow {
  display: inline-block;
  background: rgba(201,120,86,0.1);
  color: var(--primary);
  font-family: 'Geist Mono', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 1.5rem;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}
.hero h1 span { color: var(--primary); }
.hero p {
  color: var(--muted-foreground);
  font-size: 1rem;
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ── Section title ── */
.section-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 0.4rem;
  text-align: center;
}
.section-sub {
  color: var(--muted-foreground);
  font-size: 0.9rem;
  text-align: center;
  margin-bottom: 2.25rem;
}

/* ── Categorias (cards de tema) ── */
.categories-section { margin: 4rem 0; }
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.category-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  font-family: inherit;
  color: inherit;
}
.category-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}
.category-card.active {
  border-color: var(--primary);
  background: rgba(201,120,86,0.04);
}
.category-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center; justify-content: center;
  margin-bottom: 0.85rem;
  font-size: 1rem;
}
.category-name {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}
.category-desc {
  color: var(--muted-foreground);
  font-size: 0.78rem;
  line-height: 1.5;
  margin-bottom: 0.85rem;
  min-height: 2.6em;
}
.category-count {
  font-family: 'Geist Mono', monospace;
  font-size: 0.72rem;
  color: var(--muted-foreground);
}

/* ── Filtros ── */
.filters {
  position: sticky;
  top: 64px;
  z-index: 30;
  background: var(--background);
  padding: 1.25rem 0 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.filters-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.filter-chip {
  padding: 0.4rem 0.85rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: 'Geist Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted-foreground);
  transition: all 0.15s;
}
.filter-chip:hover { border-color: var(--primary); color: var(--primary); }
.filter-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.filter-count {
  margin-left: auto;
  font-family: 'Geist Mono', monospace;
  font-size: 0.78rem;
  color: var(--muted-foreground);
}

/* ── Skills grid ── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}
.skill-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
}
.skill-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}
.skill-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.skill-num {
  font-family: 'Geist Mono', monospace;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  font-weight: 600;
}
.skill-badge {
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-family: 'Geist Mono', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.skill-badge.iniciante { background: rgba(74,124,89,0.12); color: var(--success); }
.skill-badge.intermediário, .skill-badge.intermediario { background: rgba(201,120,86,0.12); color: var(--primary); }
.skill-badge.avançado, .skill-badge.avancado { background: rgba(196,69,69,0.12); color: var(--error); }

.skill-name {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}
.skill-desc {
  color: var(--muted-foreground);
  font-size: 0.83rem;
  line-height: 1.55;
  margin-bottom: 1rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.skill-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Geist Mono', monospace;
  font-size: 0.7rem;
  color: var(--muted-foreground);
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}
.skill-tipo { color: var(--primary); font-weight: 600; }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  color: var(--muted-foreground);
  font-size: 0.95rem;
}

/* ── Modal (skill detail) ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 100;
  display: none;
  padding: 2rem 1rem;
  overflow-y: auto;
}
.modal-overlay.open { display: block; }
.modal {
  background: var(--background);
  max-width: 760px;
  margin: 0 auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 2.5rem 2rem;
  position: relative;
  box-shadow: 0 20px 50px rgba(0,0,0,0.18);
}
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px; height: 32px;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  color: var(--muted-foreground);
  display: inline-flex;
  align-items: center; justify-content: center;
  transition: background 0.15s;
}
.modal-close:hover { background: var(--muted); color: var(--foreground); }

.modal-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Geist Mono', monospace;
  font-size: 0.78rem;
  color: var(--muted-foreground);
  background: none;
  border: none;
  cursor: pointer;
  margin-bottom: 1.5rem;
}
.modal-back:hover { color: var(--primary); }

.modal-num {
  font-family: 'Geist Mono', monospace;
  font-size: 0.78rem;
  color: var(--muted-foreground);
  margin-bottom: 0.4rem;
}
.modal h2 {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin-bottom: 1rem;
  padding-right: 130px;
}
.modal-tags {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Geist Mono', monospace;
  font-size: 0.78rem;
  color: var(--muted-foreground);
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.modal-tag-sep { color: var(--border); }
.modal-tag.cat { color: var(--primary); font-weight: 600; }

.modal-section { margin-bottom: 1.5rem; }
.modal-section-label {
  font-family: 'Geist Mono', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin-bottom: 0.6rem;
}
.modal-section-content {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--foreground);
  white-space: pre-wrap;
}
.modal-section-content ul { padding-left: 1.5rem; }

.modal-prompt-wrap {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 0.5rem;
}
.modal-prompt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.modal-prompt-header .label {
  font-family: 'Geist Mono', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: 'Geist Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--foreground);
  transition: all 0.15s;
}
.copy-btn:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.copy-btn.copied { background: var(--success); border-color: var(--success); color: #fff; }

.modal-prompt-body {
  padding: 1rem;
  font-family: 'Geist Mono', monospace;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--foreground);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 480px;
  overflow-y: auto;
}

.modal-download {
  position: absolute;
  top: 1.5rem;
  right: 3.5rem;
}

/* ── Auth pages ── */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  box-shadow: 0 20px 50px rgba(0,0,0,0.04);
}
.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}
.auth-logo .logo {
  font-size: 1.05rem;
  justify-content: center;
}
.auth-card h1 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
  text-align: center;
}
.auth-card p.lead {
  color: var(--muted-foreground);
  font-size: 0.88rem;
  margin-bottom: 1.75rem;
  text-align: center;
  line-height: 1.55;
}
.auth-form { display: flex; flex-direction: column; gap: 0.85rem; }
.auth-input {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--background);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--foreground);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(201,120,86,0.15);
}
.auth-status {
  font-size: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  margin-top: 0.5rem;
  display: none;
  line-height: 1.5;
}
.auth-status.show { display: block; }
.auth-status.success { background: rgba(74,124,89,0.1); color: var(--success); border: 1px solid rgba(74,124,89,0.2); }
.auth-status.error { background: rgba(196,69,69,0.1); color: var(--error); border: 1px solid rgba(196,69,69,0.2); }
.auth-status.info { background: rgba(74,107,138,0.1); color: var(--info); border: 1px solid rgba(74,107,138,0.2); }
.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.82rem;
  color: var(--muted-foreground);
}
.auth-footer a { color: var(--primary); text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }

/* ── Loading ── */
.loading {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-right: 0.5rem;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--muted) 25%, var(--border) 50%, var(--muted) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
  height: 200px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Toast (notification) ── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: var(--foreground);
  color: var(--background);
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 200;
  transition: transform 0.3s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ── Mobile ── */
@media (max-width: 768px) {
  .header { padding: 0.7rem 1rem; }
  .header-inner { gap: 0.75rem; }
  .logo span:not(.logo-mark) { display: none; }
  .header-search { max-width: none; }
  main { padding: 2rem 0 4rem; }
  .hero { padding: 2rem 1rem 2.5rem; }
  .hero h1 { font-size: 2rem; }
  .categories-grid { grid-template-columns: repeat(2, 1fr); gap: 0.7rem; }
  .category-card { padding: 1rem; }
  .category-name { font-size: 0.85rem; }
  .category-desc { display: none; }
  .skills-grid { grid-template-columns: 1fr; }
  .modal { padding: 2rem 1.25rem; }
  .modal h2 { font-size: 1.4rem; padding-right: 50px; }
  .modal-download { display: none; }
  .filters { top: 56px; }
}
