/* ============================================
   Hexploitable — Custom Dark Theme
   Palette:
     #0C0F14  backgrounds
     #1A1F2B  surfaces/cards
     #A855F7  accent purple
     #7C3AED  deep purple (hover)
     #E8E6E1  cream text
   ============================================ */

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

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: #0C0F14;
  color: #E8E6E1;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: #A855F7;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #7C3AED;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

.container {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- Header / Nav --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(12, 15, 20, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(168, 85, 247, 0.15);
}

.nav-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem;
  font-weight: 600;
  color: #E8E6E1;
  text-decoration: none;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.site-logo:hover {
  color: #E8E6E1;
}

.logo-icon {
  flex-shrink: 0;
}

.logo-text {
  color: #E8E6E1;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.nav-link {
  color: #9ca3af;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  position: relative;
  padding-bottom: 4px;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: #A855F7;
  transition: width 0.25s ease;
}

.nav-link:hover,
.nav-link.active {
  color: #E8E6E1;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* --- Hero --- */
.hero {
  padding: 5rem 1.5rem 3rem;
  text-align: center;
  background: linear-gradient(180deg, rgba(26, 31, 43, 0.4) 0%, rgba(12, 15, 20, 0) 100%);
}

.hero-container {
  max-width: 600px;
  margin: 0 auto;
}

.hero-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 3rem;
  font-weight: 700;
  color: #E8E6E1;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: #9ca3af;
  font-weight: 400;
}

/* --- Section Headings --- */
.section-heading {
  font-size: 1.5rem;
  font-weight: 600;
  color: #E8E6E1;
  margin-bottom: 2rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid rgba(168, 85, 247, 0.3);
}

/* --- Posts Grid --- */
.posts-section,
.list-section {
  padding: 2rem 0 4rem;
}

.posts-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* --- Post Card --- */
.post-card {
  background: #1A1F2B;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}

.post-card:hover {
  border-color: rgba(168, 85, 247, 0.35);
  box-shadow: 0 0 24px rgba(168, 85, 247, 0.08);
  transform: translateY(-2px);
}

.post-card-link {
  display: block;
  padding: 1.75rem;
  text-decoration: none;
  color: inherit;
}

.post-card-link:hover {
  color: inherit;
}

.post-card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #E8E6E1;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
  color: #6b7280;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.post-card-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 500;
  color: #A855F7;
  background: rgba(168, 85, 247, 0.1);
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  text-transform: lowercase;
  text-decoration: none;
}

.tag:hover {
  background: rgba(168, 85, 247, 0.2);
  color: #A855F7;
}

.post-card-excerpt {
  font-size: 0.9rem;
  color: #9ca3af;
  line-height: 1.6;
}

/* --- Single Post --- */
.post {
  padding: 3rem 0 5rem;
}

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

.post-title {
  font-size: 2.25rem;
  font-weight: 700;
  color: #E8E6E1;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 0.75rem;
}

.post-author::before {
  content: '\00b7';
  margin-right: 0.75rem;
}

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

/* --- Hexagon Avatar --- */
img.hex-avatar {
  width: 240px !important;
  height: 240px !important;
  object-fit: cover !important;
  object-position: center 20% !important;
  clip-path: polygon(15% 0%, 85% 0%, 100% 15%, 100% 85%, 85% 100%, 15% 100%, 0% 85%, 0% 15%) !important;
  border-radius: 0 !important;
  margin: 0.5rem auto 1rem;
  display: block;
}

/* --- Post Content --- */
.post-content {
  font-size: 1.05rem;
  line-height: 1.8;
}

.post-content h1 {
  font-size: 1.85rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  color: #E8E6E1;
  letter-spacing: -0.01em;
}

.post-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 2.25rem 0 0.75rem;
  color: #E8E6E1;
}

.post-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
  color: #E8E6E1;
}

.post-content h4,
.post-content h5,
.post-content h6 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 1.75rem 0 0.5rem;
  color: #E8E6E1;
}

.post-content p {
  margin-bottom: 1.25rem;
  text-align: justify;
}

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

.post-content li {
  margin-bottom: 0.35rem;
}

.post-content blockquote {
  border-left: 3px solid #A855F7;
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: rgba(26, 31, 43, 0.6);
  border-radius: 0 6px 6px 0;
  color: #d1d5db;
  font-style: italic;
}

.post-content hr {
  border: none;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 2.5rem 0;
}

/* --- Code --- */
.post-content code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.88em;
}

.post-content p code,
.post-content li code,
.post-content h1 code,
.post-content h2 code,
.post-content h3 code,
.post-content h4 code,
.post-content h5 code,
.post-content h6 code {
  background: rgba(168, 85, 247, 0.1);
  color: #C084FC;
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.85em;
}

.post-content pre {
  background: #1A1F2B;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  line-height: 1.55;
}

.post-content pre code {
  background: none;
  color: #E8E6E1;
  padding: 0;
  border-radius: 0;
  font-size: 0.85rem;
}

/* --- Copy button --- */
.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #9ca3af;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.highlight:hover .copy-btn {
  opacity: 1;
}

.copy-btn:hover {
  background: rgba(168, 85, 247, 0.15);
  border-color: rgba(168, 85, 247, 0.3);
  color: #A855F7;
}

/* scrollbar for code blocks */
.post-content pre::-webkit-scrollbar {
  height: 6px;
}

.post-content pre::-webkit-scrollbar-track {
  background: transparent;
}

.post-content pre::-webkit-scrollbar-thumb {
  background: rgba(168, 85, 247, 0.25);
  border-radius: 3px;
}

/* --- List content (about, cv pages) --- */
.list-content {
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 2.5rem;
}

.list-content p {
  margin-bottom: 1.25rem;
}

.list-content img {
  margin: 1rem 0;
}

/* --- Terms / Taxonomy --- */
.terms-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.term-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #1A1F2B;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  text-decoration: none;
  color: #E8E6E1;
  transition: border-color 0.2s ease;
}

.term-item:hover {
  border-color: rgba(168, 85, 247, 0.4);
  color: #E8E6E1;
}

.term-count {
  font-size: 0.75rem;
  color: #A855F7;
  background: rgba(168, 85, 247, 0.1);
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
}

/* --- Pagination --- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 3rem;
  list-style: none;
}

.page-item .page-link {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
  color: #9ca3af;
  background: #1A1F2B;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.page-item .page-link:hover {
  border-color: rgba(168, 85, 247, 0.4);
  color: #E8E6E1;
}

.page-item.active .page-link {
  background: #A855F7;
  border-color: #A855F7;
  color: #fff;
}

.page-item.disabled .page-link {
  opacity: 0.3;
  pointer-events: none;
}

/* --- Footer --- */
.site-footer {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 2rem 0;
}

.footer-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1.5rem;
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1rem;
}

.footer-link {
  font-size: 0.85rem;
  color: #9ca3af;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: #A855F7;
}

.footer-copy {
  font-size: 0.8rem;
  color: #4b5563;
}

/* --- Responsive --- */
@media (max-width: 640px) {
  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .post-title {
    font-size: 1.65rem;
  }

  .nav-links {
    gap: 1.25rem;
  }

  .nav-link {
    font-size: 0.8rem;
  }

  .post-card-link {
    padding: 1.25rem;
  }

  .post-content pre {
    padding: 1rem;
    border-radius: 6px;
    font-size: 0.8rem;
  }
}
