/* Step Into Dev Theme - Custom CSS */

/* ===================================
   CSS Custom Properties
   =================================== */

:root {
  /* Colors */
  --bg-primary: #030712;
  --bg-card: rgba(255, 255, 255, 0.05);
  --bg-card-hover: rgba(255, 255, 255, 0.1);
  --border-default: rgba(255, 255, 255, 0.1);
  --border-hover: rgba(59, 130, 246, 0.4);
  
  /* Accent Colors */
  --blue-500: #3b82f6;
  --blue-400: #60a5fa;
  --blue-600: #2563eb;
  --blue-950: #172554;
  --cyan-400: #22d3ee;
  --gray-900: #111827;
  
  /* Text Colors */
  --text-primary: #ffffff;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  /* Tag Colors */
  --tag-bg: rgba(59, 130, 246, 0.15);
  --tag-text: #60a5fa;
  
  /* Spacing */
  --container-max: 56rem;
  --container-narrow: 65ch;
  --container-padding: 1.5rem;
  
  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 300ms ease;
}

/* ===================================
   Reset & Base Styles
   =================================== */

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

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

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

a {
  color: inherit;
  text-decoration: none;
}

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

ul, ol {
  list-style: none;
}

/* ===================================
   Background Gradient Effects
   =================================== */

.bg-gradient {
  position: fixed;
  pointer-events: none;
  border-radius: 9999px;
  filter: blur(64px);
  z-index: -1;
}

.bg-gradient-top-right {
  top: -20%;
  right: -10%;
  width: 40%;
  height: 40%;
  background: rgba(30, 58, 138, 0.2);
}

.bg-gradient-bottom-left {
  bottom: -20%;
  left: -10%;
  width: 40%;
  height: 40%;
  background: rgba(22, 78, 99, 0.1);
}

/* ===================================
   Layout
   =================================== */

.site-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-content {
  flex: 1;
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.container-narrow {
  max-width: var(--container-narrow);
}

/* ===================================
   Header & Navigation
   =================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(3, 7, 18, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-default);
}

.nav-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 1rem var(--container-padding);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.logo-icon svg {
  width: 100%;
  height: 100%;
}

.site-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

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

/* ===================================
   Hero Section
   =================================== */

.hero-section {
  padding: 4rem 0 3rem;
  text-align: center;
}

.hero-title {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 36rem;
  margin: 0 auto 2.5rem;
}

.hero-image {
  max-width: 48rem;
  margin: 0 auto;
}

.hero-image-inner {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 0.75rem;
  border: 1px solid var(--border-default);
  background: linear-gradient(135deg, var(--blue-950) 0%, var(--gray-900) 100%);
  overflow: hidden;
}

.hero-grid-overlay {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(59, 130, 246, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.1) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===================================
   Posts Section
   =================================== */

.posts-section {
  padding: 2rem 0 4rem;
}

.section-header {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.posts-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.view-all {
  margin-top: 2rem;
  text-align: center;
}

.view-all-link {
  font-size: 0.875rem;
  color: var(--blue-400);
  transition: color var(--transition-fast);
}

.view-all-link:hover {
  color: var(--blue-500);
}

/* ===================================
   Post Card
   =================================== */

.post-card {
  border-radius: 0.75rem;
  border: 1px solid var(--border-default);
  background-color: var(--bg-card);
  transition: 
    border-color var(--transition-base),
    background-color var(--transition-base);
}

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

.post-card-link {
  display: block;
  padding: 1.5rem;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.tag {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 0.375rem;
  background-color: var(--tag-bg);
  color: var(--tag-text);
}

.tag-link {
  transition: background-color var(--transition-fast);
}

.tag-link:hover {
  background-color: rgba(59, 130, 246, 0.25);
}

.post-card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  transition: color var(--transition-base);
}

.post-card:hover .post-card-title {
  color: var(--blue-400);
}

.post-card-excerpt {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.meta-separator {
  color: var(--text-muted);
}

/* ===================================
   Page Header
   =================================== */

.page-header {
  padding: 3rem 0 2rem;
}

.page-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.page-description {
  font-size: 1rem;
  color: var(--text-secondary);
}

/* ===================================
   Single Post
   =================================== */

.single-post {
  padding: 2rem 0 4rem;
}

.post-header {
  margin-bottom: 2rem;
}

.post-title {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.post-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.post-cover {
  margin: 2rem 0;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid var(--border-default);
}

.post-cover-img {
  width: 100%;
  height: auto;
}

/* ===================================
   Prose Content
   =================================== */

.prose {
  color: var(--text-secondary);
  line-height: 1.75;
}

.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
  color: var(--text-primary);
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.prose h2 {
  font-size: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-default);
}

.prose h3 {
  font-size: 1.25rem;
}

.prose h4 {
  font-size: 1.125rem;
}

.prose p {
  margin-bottom: 1.25rem;
}

.prose a {
  color: var(--blue-400);
  transition: color var(--transition-fast);
}

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

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

.prose em {
  font-style: italic;
}

.prose ul, .prose ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.prose ul {
  list-style-type: disc;
}

.prose ol {
  list-style-type: decimal;
}

.prose li {
  margin-bottom: 0.5rem;
}

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

.prose blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  border-left: 3px solid var(--blue-500);
  background-color: var(--bg-card);
  border-radius: 0 0.5rem 0.5rem 0;
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  padding: 0.2em 0.4em;
  background-color: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 0.25rem;
  color: var(--cyan-400);
}

.prose pre {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background-color: var(--gray-900);
  border: 1px solid var(--border-default);
  border-radius: 0.5rem;
  overflow-x: auto;
}

.prose pre code {
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.prose img {
  margin: 1.5rem 0;
  border-radius: 0.5rem;
  border: 1px solid var(--border-default);
}

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

.prose table {
  width: 100%;
  margin: 1.5rem 0;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.prose th, .prose td {
  padding: 0.75rem;
  border: 1px solid var(--border-default);
  text-align: left;
}

.prose th {
  background-color: var(--bg-card);
  color: var(--text-primary);
  font-weight: 600;
}

/* ===================================
   Post Navigation
   =================================== */

.post-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-default);
}

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.post-nav-link {
  padding: 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-default);
  background-color: var(--bg-card);
  transition: 
    border-color var(--transition-base),
    background-color var(--transition-base);
}

.post-nav-link:hover {
  border-color: var(--border-hover);
  background-color: var(--bg-card-hover);
}

.post-nav-prev {
  text-align: left;
}

.post-nav-next {
  text-align: right;
  grid-column: 2;
}

.post-nav-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.post-nav-title {
  display: block;
  font-size: 0.875rem;
  color: var(--text-primary);
  font-weight: 500;
}

/* ===================================
   Terms/Tags List
   =================================== */

.terms-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.term-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-default);
  background-color: var(--bg-card);
  transition: 
    border-color var(--transition-base),
    background-color var(--transition-base);
}

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

.term-name {
  font-size: 0.875rem;
  color: var(--text-primary);
}

.term-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.125rem 0.5rem;
  background-color: var(--bg-card);
  border-radius: 0.25rem;
}

/* ===================================
   Newsletter Section
   =================================== */

.newsletter-section {
  margin-top: 3rem;
  padding-bottom: 3rem;
}

.newsletter-container {
  padding: 2rem;
  border-radius: 0.75rem;
  background-color: rgba(23, 37, 84, 0.3);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.newsletter-content {
  margin-bottom: 1.5rem;
}

.newsletter-heading {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.newsletter-description {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.newsletter-form {
  display: flex;
  gap: 0.75rem;
  max-width: 24rem;
}

.newsletter-input {
  flex: 1;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text-primary);
  background-color: var(--bg-card-hover);
  border: 1px solid var(--border-default);
  border-radius: 0.5rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.newsletter-input::placeholder {
  color: var(--text-muted);
}

.newsletter-input:focus {
  border-color: var(--blue-500);
}

.newsletter-button {
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-primary);
  background-color: var(--blue-600);
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.newsletter-button:hover {
  background-color: var(--blue-500);
}

/* ===================================
   Footer
   =================================== */

.site-footer {
  border-top: 1px solid var(--border-default);
  padding: 2rem 0;
}

.footer-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
  text-align: center;
}

.footer-text {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-text a {
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

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

/* ===================================
   Pagination
   =================================== */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2rem;
  padding: 1rem 0;
}

.pagination .page-item {
  display: inline-block;
}

.pagination .page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  background-color: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 0.5rem;
  transition: 
    color var(--transition-fast),
    border-color var(--transition-fast),
    background-color var(--transition-fast);
}

.pagination .page-link:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background-color: var(--bg-card-hover);
}

.pagination .page-item.active .page-link {
  color: var(--text-primary);
  background-color: var(--blue-600);
  border-color: var(--blue-600);
}

.pagination .page-item.disabled .page-link {
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.5;
}

/* ===================================
   Responsive Design
   =================================== */

@media (max-width: 768px) {
  :root {
    --container-padding: 1rem;
  }
  
  .hero-title {
    font-size: 1.75rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
  
  .post-title {
    font-size: 1.75rem;
  }
  
  .page-title {
    font-size: 1.5rem;
  }
  
  .nav-links {
    gap: 1.25rem;
  }
  
  .newsletter-form {
    flex-direction: column;
    max-width: 100%;
  }
  
  .newsletter-button {
    width: 100%;
  }
  
  .post-nav {
    grid-template-columns: 1fr;
  }
  
  .post-nav-next {
    grid-column: 1;
    text-align: left;
  }
}

@media (max-width: 480px) {
  .site-title {
    font-size: 1rem;
  }
  
  .nav-links {
    gap: 1rem;
  }
  
  .nav-link {
    font-size: 0.8125rem;
  }
  
  .post-card-link {
    padding: 1rem;
  }
  
  .post-card-title {
    font-size: 1.125rem;
  }
}

/* ===================================
   Syntax Highlighting (Basic)
   =================================== */

.highlight {
  margin: 1.5rem 0;
  border-radius: 0.5rem;
  overflow: hidden;
}

.highlight pre {
  margin: 0;
  border-radius: 0;
}

/* Basic syntax colors */
.highlight .c,
.highlight .c1,
.highlight .cm,
.highlight .cp,
.highlight .cs { color: #6b7280; } /* Comments */

.highlight .k,
.highlight .kc,
.highlight .kd,
.highlight .kn,
.highlight .kp,
.highlight .kr,
.highlight .kt { color: #c084fc; } /* Keywords */

.highlight .s,
.highlight .s1,
.highlight .s2,
.highlight .sb,
.highlight .sc,
.highlight .sd,
.highlight .se,
.highlight .sh,
.highlight .si,
.highlight .sx,
.highlight .sr,
.highlight .ss { color: #a5f3fc; } /* Strings */

.highlight .n,
.highlight .na,
.highlight .nb,
.highlight .nc,
.highlight .nd,
.highlight .ne,
.highlight .nf,
.highlight .ni,
.highlight .nl,
.highlight .nn,
.highlight .no,
.highlight .nt,
.highlight .nv { color: #93c5fd; } /* Names */

.highlight .m,
.highlight .mf,
.highlight .mh,
.highlight .mi,
.highlight .mo { color: #f472b6; } /* Numbers */

.highlight .o,
.highlight .ow { color: #f8fafc; } /* Operators */

.highlight .p { color: #94a3b8; } /* Punctuation */

.highlight .err { color: #f87171; } /* Errors */

/* ===================================
   Heading Anchors
   =================================== */

.heading-anchor {
  margin-left: 0.5rem;
  font-size: 0.875em;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

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

.heading-anchor:hover {
  color: var(--blue-400);
}

/* ===================================
   404 Error Page
   =================================== */

.error-page {
  text-align: center;
  padding: 6rem 0;
}

.error-title {
  font-size: 6rem;
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1;
  margin-bottom: 1rem;
}

.error-message {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.error-description {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.error-link {
  display: inline-block;
  font-size: 0.875rem;
  color: var(--blue-400);
  transition: color var(--transition-fast);
}

.error-link:hover {
  color: var(--blue-500);
}

/* ===================================
   Selection Styles
   =================================== */

::selection {
  background-color: rgba(59, 130, 246, 0.3);
  color: var(--text-primary);
}

/* ===================================
   Scrollbar Styles
   =================================== */

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-default) var(--bg-primary);
}

