/* ==========================================================================
   Soldrd — Global Design System
   Aesthetic: Dark editorial-industrial. Terminal-inspired with electric accents.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,900&family=Inter+Tight:wght@400;500;600;700&display=swap');

:root {
  /* Color system */
  --bg-void: #0a0b0d;
  --bg-deep: #101216;
  --bg-panel: #161a20;
  --bg-elevated: #1d2229;
  --bg-hover: #232932;

  --border-dim: #232932;
  --border-mid: #2e3540;
  --border-bright: #3d4654;

  --text-primary: #e8eaed;
  --text-secondary: #a8b0bd;
  --text-tertiary: #6c7484;
  --text-muted: #4a5160;

  --accent-electric: #00e5ff;       /* primary cyan */
  --accent-electric-dim: #00b8cc;
  --accent-amber: #ffb547;          /* warning / pricing */
  --accent-solder: #ff5a4e;         /* destructive / live */
  --accent-pcb: #00d97e;            /* success / verified */

  /* Typography */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter Tight', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  /* Layout */
  --max-width: 1280px;
  --header-height: 68px;

  /* Effects */
  --shadow-glow: 0 0 0 1px rgba(0, 229, 255, 0.15), 0 8px 32px rgba(0, 229, 255, 0.08);
  --shadow-card: 0 1px 0 rgba(255,255,255,0.03) inset, 0 8px 24px rgba(0,0,0,0.4);
  --transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-void);
  color: var(--text-primary);
  line-height: 1.55;
  font-size: 15px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(ellipse 80% 60% at 50% -20%, rgba(0, 229, 255, 0.08), transparent 60%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(255, 181, 71, 0.04), transparent 60%);
  background-attachment: fixed;
}

/* PCB grid background overlay — subtle */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 229, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 85%);
}

/* Typography */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
h1 { font-size: clamp(2.5rem, 6vw, 5rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.75rem); }
h3 { font-size: 1.4rem; letter-spacing: -0.01em; }

.mono { font-family: var(--font-mono); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-electric);
  font-weight: 500;
}

a { color: var(--accent-electric); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--text-primary); }

/* Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-5);
  position: relative;
  z-index: 1;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 11, 13, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-dim);
  height: var(--header-height);
  display: flex;
  align-items: center;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 20px;
  color: var(--text-primary);
  letter-spacing: -0.03em;
}

.logo:hover { color: var(--text-primary); }

.logo-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--accent-electric), #007a8c);
  color: var(--bg-void);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.4);
}

.logo-mark::before { content: '◊'; }

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.nav a {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}
.nav a:hover, .nav a.active { color: var(--text-primary); }

.nav-actions { display: flex; gap: var(--space-3); align-items: center; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 10px 18px;
  border-radius: 6px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent-electric);
  color: var(--bg-void);
  font-weight: 600;
}
.btn-primary:hover { background: #5cf0ff; transform: translateY(-1px); color: var(--bg-void); box-shadow: 0 8px 24px rgba(0, 229, 255, 0.3); }
.btn-ghost { background: transparent; color: var(--text-primary); border-color: var(--border-mid); }
.btn-ghost:hover { border-color: var(--accent-electric); color: var(--accent-electric); }
.btn-dark { background: var(--bg-elevated); color: var(--text-primary); border-color: var(--border-mid); }
.btn-dark:hover { background: var(--bg-hover); border-color: var(--border-bright); color: var(--text-primary); }
.btn-lg { padding: 14px 26px; font-size: 15px; }
.btn-sm { padding: 7px 12px; font-size: 13px; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--space-4); }
.field label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  font-weight: 500;
}
.field input, .field textarea, .field select {
  background: var(--bg-deep);
  border: 1px solid var(--border-mid);
  color: var(--text-primary);
  padding: 11px 14px;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 14px;
  transition: var(--transition);
  width: 100%;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--accent-electric);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.12);
}
.field textarea { resize: vertical; min-height: 110px; font-family: var(--font-body); }
.field .hint { font-size: 12px; color: var(--text-tertiary); }
.field .error { font-size: 12px; color: var(--accent-solder); }

/* Cards */
.card {
  background: var(--bg-panel);
  border: 1px solid var(--border-dim);
  border-radius: 10px;
  padding: var(--space-5);
  transition: var(--transition);
}
.card:hover { border-color: var(--border-bright); }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  padding: 4px 9px;
  border-radius: 4px;
  border: 1px solid;
}
.badge-verified { color: var(--accent-pcb); border-color: rgba(0, 217, 126, 0.3); background: rgba(0, 217, 126, 0.08); }
.badge-pending  { color: var(--accent-amber); border-color: rgba(255, 181, 71, 0.3); background: rgba(255, 181, 71, 0.08); }
.badge-rejected { color: var(--accent-solder); border-color: rgba(255, 90, 78, 0.3); background: rgba(255, 90, 78, 0.08); }
.badge-trending { color: var(--accent-electric); border-color: rgba(0, 229, 255, 0.3); background: rgba(0, 229, 255, 0.08); }
.badge-sold     { color: var(--text-tertiary); border-color: var(--border-mid); }

/* Project card grid */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: var(--space-5); }

.project-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-dim);
  border-radius: 10px;
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  position: relative;
}
.project-card:hover { border-color: var(--accent-electric); transform: translateY(-3px); box-shadow: 0 12px 32px rgba(0,0,0,0.4), 0 0 0 1px rgba(0, 229, 255, 0.2); }

.project-card .thumb {
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, #1a1f28, #0f1318);
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.project-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.project-card .thumb-fallback { font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); letter-spacing: 0.1em; }
.project-card .thumb-overlay { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; }

.project-card .body { padding: var(--space-4); display: flex; flex-direction: column; gap: 8px; flex: 1; }
.project-card .title { font-family: var(--font-display); font-weight: 600; font-size: 17px; color: var(--text-primary); line-height: 1.25; }
.project-card .meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); letter-spacing: 0.05em; display: flex; gap: 10px; }
.project-card .footer { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: var(--space-3); border-top: 1px solid var(--border-dim); }
.project-card .price { font-family: var(--font-mono); font-size: 16px; font-weight: 700; color: var(--accent-amber); }
.project-card .price .currency { font-size: 11px; color: var(--text-tertiary); margin-right: 3px; }
.project-card .views { font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); }

/* Tags */
.tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 3px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-dim);
}

/* Footer */
.site-footer {
  margin-top: var(--space-9);
  padding: var(--space-7) 0 var(--space-5);
  border-top: 1px solid var(--border-dim);
  background: var(--bg-deep);
}
.site-footer .container { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: var(--space-6); }
.site-footer h4 { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--text-tertiary); margin-bottom: var(--space-3); font-weight: 500; }
.site-footer ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.site-footer a { color: var(--text-secondary); font-size: 14px; }
.site-footer a:hover { color: var(--accent-electric); }
.site-footer .copyright { grid-column: 1 / -1; margin-top: var(--space-6); padding-top: var(--space-5); border-top: 1px solid var(--border-dim); color: var(--text-tertiary); font-family: var(--font-mono); font-size: 12px; }

/* Utilities */
.flex { display: flex; }
.center { display: grid; place-items: center; }
.space-between { display: flex; justify-content: space-between; align-items: center; }
.text-muted { color: var(--text-tertiary); }
.text-mono { font-family: var(--font-mono); }

/* Toast */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--bg-elevated);
  border: 1px solid var(--accent-pcb);
  color: var(--text-primary);
  padding: 14px 20px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  z-index: 1000;
  animation: toastIn 300ms ease-out;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 380px;
}
.toast.error { border-color: var(--accent-solder); }
.toast.warn  { border-color: var(--accent-amber); }
@keyframes toastIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(5, 6, 8, 0.78);
  backdrop-filter: blur(8px); z-index: 200;
  display: grid; place-items: center; padding: 20px;
}
.modal {
  background: var(--bg-panel);
  border: 1px solid var(--border-mid);
  border-radius: 12px;
  max-width: 480px; width: 100%;
  padding: var(--space-6);
}
.modal h3 { margin-bottom: var(--space-3); }
.modal p { color: var(--text-secondary); margin-bottom: var(--space-5); }
.modal-actions { display: flex; gap: var(--space-3); justify-content: flex-end; }

/* Responsive */
@media (max-width: 900px) {
  .nav { display: none; }
  .site-footer .container { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  :root { --space-5: 16px; }
  .site-footer .container { grid-template-columns: 1fr; }
  .project-grid { grid-template-columns: 1fr; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-bright); }

/* External link indicator (Parts Store in nav) */
.nav .ext-arrow {
  display: inline-block;
  margin-left: 3px;
  font-size: 10px;
  color: var(--text-tertiary);
  transition: color 0.15s ease;
}

.nav a:hover .ext-arrow {
  color: var(--accent-electric);
}
