/* ProtoQuiz Blog Shared Styles */
/* Inherits design system from main site */

:root {
  --bg: #05080c;
  --panel: #0a0f15;
  --ink: #e6edf7;
  --muted: #9aa4b2;
  --line: #16202b;
  --cyan: #22d3ee;
  --violet: #a855f7;
  --success: #10b981;
  --warning: #f59e0b;
  --radius: 18px;
  --max: 1080px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Animated gradient background (same as main site) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle 800px at 20% 20%, rgba(34,211,238,.12), transparent),
    radial-gradient(circle 600px at 80% 50%, rgba(168,85,247,.1), transparent),
    radial-gradient(circle 700px at 50% 90%, rgba(34,211,238,.08), transparent);
  pointer-events: none;
  animation: gradientFloat 20s ease-in-out infinite;
}

@keyframes gradientFloat {
  0%, 100% { transform: scale(1) rotate(0deg); }
  33% { transform: scale(1.1) rotate(1deg); }
  66% { transform: scale(0.95) rotate(-1deg); }
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity .2s;
}

a:hover {
  opacity: 0.85;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

/* Navigation */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(5,8,12,.95);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -.02em;
}

.brand-link img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(34,211,238,.2);
}

.nav-links {
  display: flex;
  gap: 16px;
  align-items: center;
}

.nav-btn {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  transition: all .2s;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
}

.nav-btn:hover {
  border-color: var(--line);
  background: rgba(255,255,255,.03);
}

.nav-btn.primary {
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  color: #05080c;
  border: none;
  box-shadow: 0 4px 16px rgba(34,211,238,.25);
}

.nav-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(34,211,238,.35);
  opacity: 1;
}

/* Blog Layout */
main {
  padding-top: 120px;
  padding-bottom: 80px;
  min-height: 100vh;
}

.blog-header {
  text-align: center;
  margin-bottom: 60px;
}

.blog-header h1 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 900;
  letter-spacing: -.03em;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.blog-header p {
  font-size: 18px;
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto;
}

/* Filters */
.filters {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  transition: all .2s;
}

.filter-btn:hover,
.filter-btn.active {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(34,211,238,.05);
}

/* Post Grid */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 60px;
}

.post-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  transition: all .3s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.post-card:hover {
  border-color: var(--cyan);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(34,211,238,.15);
}

.post-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  opacity: 0;
  transition: opacity .3s;
}

.post-card:hover::before {
  opacity: 1;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}

.post-category {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(34,211,238,.1);
  color: var(--cyan);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.post-category.updates {
  background: rgba(168,85,247,.1);
  color: var(--violet);
}

.post-category.stories {
  background: rgba(16,185,129,.1);
  color: var(--success);
}

.post-card h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.3;
}

.post-excerpt {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 16px;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--cyan);
}

.read-more::after {
  content: "→";
  transition: transform .2s;
}

.post-card:hover .read-more::after {
  transform: translateX(4px);
}

/* Footer */
footer {
  border-top: 1px solid var(--line);
  padding: 40px 0;
  text-align: center;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}

.footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

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

.footer-copy {
  color: var(--muted);
  font-size: 13px;
}

/* Responsive */
@media (max-width: 768px) {
  .posts-grid {
    grid-template-columns: 1fr;
  }

  .blog-header h1 {
    font-size: 2.5rem;
  }

  .filters {
    gap: 8px;
  }

  .filter-btn {
    padding: 6px 16px;
    font-size: 13px;
  }
}
