/* ============================================
   NSHkr.com Design System
   Dark-mode, developer-focused (Vercel/Linear)
   ============================================ */

/* --- Design Tokens --- */
:root {
  /* Background */
  --bg-primary: #09090b;
  --bg-secondary: #18181b;
  --bg-tertiary: #27272a;

  /* Text */
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;

  /* Accent */
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-subtle: rgba(59, 130, 246, 0.1);

  /* Borders */
  --border: #27272a;
  --border-hover: #3f3f46;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Layout */
  --container-max: 1200px;
  --header-height: 60px;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.5rem;

  /* Transitions */
  --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Legacy variable aliases (used by inline styles in content markdown) */
  --accent-primary: #3b82f6;
  --accent-secondary: #60a5fa;
  --accent-tertiary: #93bbfd;
  --border-color: #27272a;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-8: 2rem;
  --space-12: 3rem;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.main-content {
  flex: 1;
  padding: var(--space-2xl) 0;
}

/* --- Site Header --- */
.site-header {
  height: var(--header-height);
  border-bottom: 1px solid var(--border);
  background: var(--bg-primary);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(9, 9, 11, 0.85);
}

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

.site-logo {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

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

.site-logo span {
  color: var(--accent);
}

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

.site-nav a {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: color var(--transition);
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--text-primary);
}

/* Mobile hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: var(--space-sm);
}

.nav-toggle svg {
  width: 24px;
  height: 24px;
}

@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: var(--space-lg);
    gap: var(--space-md);
  }

  .site-nav.open {
    display: flex;
  }
}

/* --- Site Footer --- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  padding: var(--space-3xl) 0 var(--space-xl);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-2xl);
}

.footer-brand p {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin-top: var(--space-sm);
  max-width: 300px;
}

.footer-heading {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer-links a {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: var(--text-xs);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .footer-bottom {
    flex-direction: column;
    gap: var(--space-sm);
    text-align: center;
  }
}

/* --- Cards --- */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: border-color var(--transition), background var(--transition);
}

.card:hover {
  border-color: var(--border-hover);
  background: var(--bg-tertiary);
}

/* Project Card */
.project-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition), transform var(--transition);
}

.project-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-sm);
}

.project-card-name {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.project-card-logo {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-sm);
}

.project-card-stars {
  font-size: var(--text-xs);
  color: var(--text-muted);
  white-space: nowrap;
}

.project-card-desc {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.5;
  flex: 1;
  margin-bottom: var(--space-md);
}

.project-card-link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

.project-card-link:hover {
  color: var(--accent-hover);
}

/* --- Project Grid --- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-lg);
}

/* --- Section --- */
.section {
  margin-bottom: var(--space-3xl);
}

.section-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-sm);
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: var(--text-base);
  margin-bottom: var(--space-lg);
  max-width: 600px;
}

/* --- Badges / Tags --- */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-xs);
  font-weight: 500;
  padding: 0.2em 0.6em;
  border-radius: 9999px;
  background: var(--accent-subtle);
  color: var(--accent);
  border: 1px solid transparent;
}

.badge-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text-secondary);
}

.tech-tag {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-xs);
  font-weight: 500;
  padding: 0.25em 0.75em;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  padding: 0.5em 1.25em;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

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

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

/* --- Hero --- */
.hero {
  padding: var(--space-3xl) 0;
  text-align: center;
}

.hero-title {
  font-size: var(--text-4xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: var(--space-md);
}

.hero-subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto var(--space-xl);
}

.hero-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* Stats bar */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: var(--space-2xl);
  padding: var(--space-xl) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-3xl);
}

.stat {
  text-align: center;
}

.stat-value {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: var(--space-xs);
}

@media (max-width: 640px) {
  .hero-title {
    font-size: var(--text-3xl);
  }

  .stats-bar {
    flex-wrap: wrap;
    gap: var(--space-lg);
  }

  .stat {
    flex: 1;
    min-width: 100px;
  }
}

/* --- Prose (article content) --- */
.prose {
  font-size: var(--text-base);
  line-height: 1.75;
  color: var(--text-secondary);
  max-width: 72ch;
  margin-left: auto;
  margin-right: auto;
}

.prose > * + * {
  margin-top: 1.25em;
}

.prose h1 {
  font-size: var(--text-3xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.2;
  margin-top: 2em;
}

.prose h2 {
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.3;
  margin-top: 1.75em;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--border);
}

.prose h3 {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 1.5em;
}

.prose h4, .prose h5, .prose h6 {
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 1.5em;
}

.prose p {
  margin-top: 1.25em;
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.prose a:hover {
  color: var(--accent-hover);
}

.prose strong {
  color: var(--text-primary);
  font-weight: 600;
}

.prose ul, .prose ol {
  padding-left: 1.5em;
}

.prose li {
  margin-top: 0.5em;
}

.prose li::marker {
  color: var(--text-muted);
}

.prose blockquote {
  border-left: 3px solid var(--accent);
  padding-left: var(--space-lg);
  color: var(--text-muted);
  font-style: italic;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}

.prose img {
  border-radius: var(--radius-md);
  margin: 1.5em 0;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  margin: 1.5em 0;
}

.prose th {
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
  padding: 0.75em 1em;
  border-bottom: 2px solid var(--border);
}

.prose td {
  padding: 0.75em 1em;
  border-bottom: 1px solid var(--border);
}

.prose tr:hover td {
  background: var(--bg-secondary);
}

/* --- Code Blocks --- */
.prose code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-tertiary);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}

.prose pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  overflow-x: auto;
  margin: 1.5em 0;
}

.prose pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: var(--text-sm);
  line-height: 1.7;
}

/* Hugo highlight wrapper */
.highlight {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 1.5em 0;
}

.highlight pre {
  border: none;
  margin: 0;
  background: transparent;
}

/* --- Header Anchors --- */
.header-anchor {
  color: var(--text-muted);
  font-size: 0.7em;
  margin-left: 0.5em;
  opacity: 0;
  transition: opacity var(--transition);
  text-decoration: none;
  vertical-align: middle;
}

h1:hover .header-anchor,
h2:hover .header-anchor,
h3:hover .header-anchor,
h4:hover .header-anchor,
h5:hover .header-anchor,
h6:hover .header-anchor {
  opacity: 1;
}

/* --- Blog Post Card --- */
.post-card {
  display: block;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: border-color var(--transition), transform var(--transition);
  text-decoration: none;
  color: inherit;
}

.post-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  color: inherit;
}

.post-card-date {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.post-card-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin: var(--space-sm) 0;
}

.post-card-summary {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}

.post-card-read {
  font-size: var(--text-sm);
  color: var(--accent);
  font-weight: 500;
  margin-top: var(--space-md);
  display: inline-block;
}

/* --- Article Meta --- */
.article-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin-bottom: var(--space-xl);
}

.article-tags {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* --- Breadcrumb --- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-xl);
}

.breadcrumb a {
  color: var(--text-muted);
}

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

.breadcrumb-sep {
  color: var(--border-hover);
}

/* --- 404 --- */
.error-page {
  text-align: center;
  padding: var(--space-3xl) 0;
}

.error-code {
  font-size: 6rem;
  font-weight: 800;
  color: var(--bg-tertiary);
  line-height: 1;
}

.error-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin: var(--space-md) 0;
}

.error-desc {
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
}

/* --- Hackerspace --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.feature-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: var(--space-md);
}

.feature-title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.feature-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* --- Mermaid --- */
.mermaid {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin: 1.5em 0;
  text-align: center;
}

/* --- Utilities --- */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: var(--text-sm); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

/* --- Print --- */
@media print {
  .site-header,
  .site-footer,
  .nav-toggle {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }

  .prose a {
    color: #000;
    text-decoration: underline;
  }
}
