/* Self-hosted fonts */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 300; font-display: swap; src: url('../fonts/inter-300.ttf') format('truetype'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/inter-400.ttf') format('truetype'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/inter-500.ttf') format('truetype'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/inter-600.ttf') format('truetype'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/inter-700.ttf') format('truetype'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/jetbrains-mono-400.ttf') format('truetype'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/jetbrains-mono-700.ttf') format('truetype'); }

:root {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --accent: #06b6d4;
  --accent-hover: #22d3ee;
  --border: #334155;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: 'JetBrains Mono', monospace; font-weight: 700; }

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

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

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

/* Navigation */
nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 8px 25px rgba(6, 182, 212, 0.08);
}

/* Badge */
.badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(6, 182, 212, 0.12);
  color: var(--accent);
  border: 1px solid rgba(6, 182, 212, 0.25);
  white-space: nowrap;
}
.tag-badge:hover {
  background: rgba(6, 182, 212, 0.25);
}
.tag-badge.tag-active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 2rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--border));
}
.timeline-item {
  position: relative;
  margin-bottom: 2rem;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -2.35rem;
  top: 0.5rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-primary);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
}

/* Gallery grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}
.gallery-item {
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: 0.5rem;
  cursor: pointer;
  position: relative;
  border: 1px solid var(--border);
  transition: border-color 0.2s;
}
.gallery-item:hover {
  border-color: var(--accent);
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.gallery-item:hover img {
  transform: scale(1.08);
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.lightbox.active {
  display: flex;
}
.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 0.25rem;
}
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  padding: 1rem;
  opacity: 0.6;
  transition: opacity 0.2s;
  line-height: 1;
}
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  opacity: 1;
}
.lightbox-close { top: 0.5rem; right: 1rem; font-size: 2.5rem; }
.lightbox-prev { left: 0.5rem; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 0.5rem; top: 50%; transform: translateY(-50%); }

/* Blog filter buttons */
.filter-btn {
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.875rem;
  font-family: 'Inter', sans-serif;
}
.filter-btn:hover,
.filter-btn.active {
  background: rgba(6, 182, 212, 0.12);
  color: var(--accent);
  border-color: var(--accent);
}

/* Code blocks */
pre code,
.article-body pre code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
}
.article-body pre {
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1.25rem;
  margin: 1.5rem 0;
  overflow-x: auto;
}
.article-body code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  background: rgba(6, 182, 212, 0.08);
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
}
.article-body pre code {
  background: none;
  padding: 0;
}
.article-body p {
  margin-bottom: 1rem;
}
.article-body h2 {
  font-size: 1.5rem;
  margin: 2rem 0 1rem;
}
.article-body h3 {
  font-size: 1.25rem;
  margin: 1.5rem 0 0.75rem;
}
.article-body ul,
.article-body ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}
.article-body li {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}
.article-body img {
  border-radius: 0.5rem;
  margin: 1rem 0;
}

/* Hamburger menu */
.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
}

@media (max-width: 768px) {
  .hamburger { display: block; }
  .nav-links {
    display: none !important;
    flex-direction: column;
    width: 100%;
    padding: 1rem 0;
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    text-align: center;
  }
  .nav-links.open {
    display: flex !important;
  }
  .nav-links a {
    padding: 0.75rem 1.5rem;
  }
  h1 { font-size: 2rem !important; }
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

/* Hero gradient */
.hero-gradient {
  background: linear-gradient(135deg, var(--bg-primary) 0%, #0c1e3a 40%, #0f172a 100%);
  position: relative;
  overflow: hidden;
}
.hero-gradient::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(6, 182, 212, 0.04) 0%, transparent 50%);
  pointer-events: none;
}

/* Footer */
footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 4rem;
}

/* Scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Selection */
::selection {
  background: rgba(6, 182, 212, 0.3);
  color: var(--text-primary);
}
