:root {
  --bg: #07101e;
  --surface: #0d1b2e;
  --border: #1a2e47;
  --cyan: #22d3ee;
  --blue: #3b82f6;
  --purple: #8b5cf6;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --radius: 12px;
}

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

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

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── NAV ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7,16,30,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links { display: flex; gap: 1.5rem; }
.nav-links a { color: var(--muted); font-size: .9rem; font-weight: 500; }
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* ── HERO BLOG ── */
.blog-hero {
  text-align: center;
  padding: 5rem 2rem 3rem;
  border-bottom: 1px solid var(--border);
}

.blog-hero h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--cyan), var(--blue), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: .75rem;
}

.blog-hero p { color: var(--muted); font-size: 1.1rem; max-width: 560px; margin: 0 auto; }

/* ── GRID DE POSTS ── */
.posts-grid {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  transition: border-color .2s, transform .2s;
}

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

.post-tag {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .25rem .65rem;
  border-radius: 999px;
  width: fit-content;
}

.tag-ia     { background: rgba(34,211,238,.12); color: var(--cyan); }
.tag-robotica { background: rgba(139,92,246,.12); color: var(--purple); }
.tag-coding { background: rgba(59,130,246,.12); color: var(--blue); }
.tag-quantica { background: rgba(236,72,153,.12); color: #ec4899; }

.post-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

.post-excerpt { font-size: .9rem; color: var(--muted); }

.post-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
  font-size: .8rem;
  color: var(--muted);
}

.read-link {
  color: var(--cyan);
  font-weight: 600;
  font-size: .85rem;
  display: flex;
  align-items: center;
  gap: .3rem;
}

/* ── ARTICLE PAGE ── */
.article-wrapper {
  max-width: 760px;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
}

.article-back {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: 2rem;
}
.article-back:hover { color: var(--cyan); text-decoration: none; }

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

.article-tag { margin-bottom: 1rem; }

.article-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: .75rem;
}

.article-meta {
  display: flex;
  gap: 1rem;
  font-size: .85rem;
  color: var(--muted);
}

.article-hook {
  background: linear-gradient(135deg, rgba(34,211,238,.08), rgba(139,92,246,.08));
  border-left: 3px solid var(--cyan);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  font-size: 1.1rem;
  font-style: italic;
  color: var(--cyan);
  line-height: 1.5;
}

.article-content h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  color: var(--text);
}

.article-content h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 2rem 0 .75rem;
  color: var(--cyan);
}

.article-content p {
  margin-bottom: 1.25rem;
  color: var(--text);
}

.article-content ul, .article-content ol {
  margin: 1rem 0 1.5rem 1.5rem;
}

.article-content li {
  margin-bottom: .5rem;
  color: var(--text);
}

.article-content strong { color: var(--cyan); font-weight: 600; }

.article-content code {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: .15rem .45rem;
  border-radius: 4px;
  font-family: 'Fira Code', monospace;
  font-size: .85em;
  color: var(--purple);
}

.article-content pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.article-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: .9rem;
}

.article-content blockquote {
  border-left: 3px solid var(--purple);
  padding: .75rem 1.25rem;
  margin: 1.5rem 0;
  color: var(--muted);
  font-style: italic;
}

/* ── CTA BOX ── */
.article-cta {
  background: linear-gradient(135deg, rgba(34,211,238,.1), rgba(139,92,246,.1));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin: 3rem 0 0;
  text-align: center;
}

.article-cta h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: .5rem;
}

.article-cta p { color: var(--muted); margin-bottom: 1.25rem; font-size: .95rem; }

.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #07101e;
  font-weight: 700;
  padding: .75rem 1.75rem;
  border-radius: 999px;
  font-size: .95rem;
  transition: opacity .2s, transform .2s;
}

.btn-cta:hover { opacity: .9; transform: translateY(-2px); text-decoration: none; }

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  font-size: .85rem;
  color: var(--muted);
}

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .posts-grid { grid-template-columns: 1fr; padding: 1.5rem 1rem; }
  .article-wrapper { padding: 2rem 1rem 4rem; }
  nav { padding: 0 1rem; }
}
