:root{
  --navy: #0b2545;
  --navy-2: #123a6b;
  --blue: #1f6feb;
  --blue-light: #e8f1ff;
  --diamond: #2fb0d9;
  --mint: #4cf5e0;
  --ink: #1c2733;
  --muted: #5b6b7c;
  --line: #dde5ee;
  --bg-soft: #f6f9fc;
  --white: #ffffff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  color: var(--ink);
  background: var(--white);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 28px;
}

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

.reveal {
  opacity: 1;
  transform: none;
}
.js-anim .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.js-anim .reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .js-anim .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* Masthead */
.masthead {
  background: linear-gradient(120deg, var(--navy) 0%, var(--navy-2) 55%, var(--blue) 130%);
  position: sticky;
  top: 0;
  z-index: 50;
  transition: box-shadow 0.25s ease;
}
.masthead.scrolled {
  box-shadow: 0 6px 24px rgba(11, 37, 69, 0.28);
}

.util-row {
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.util-row .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 32px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.4px;
  color: rgba(255,255,255,0.55);
}
.pulse {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--mint);
}
.util-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--mint);
  display: inline-block;
  animation: pulse 2.4s infinite ease-in-out;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
@media (prefers-reduced-motion: reduce) {
  .util-dot { animation: none; }
}

header.main-header {
  transition: padding 0.25s ease;
}
header.main-header .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 92px;
  transition: height 0.25s ease;
}
.masthead.scrolled header.main-header .wrap {
  height: 64px;
}

.logo-svg {
  height: 50px;
  width: auto;
  display: block;
  transition: height 0.25s ease, transform 0.2s ease;
}
.logo-svg svg { height: 100%; width: auto; display: block; }
.brand:hover .logo-svg { transform: scale(1.03); }
.masthead.scrolled .logo-svg { height: 36px; }

nav {
  display: flex;
  gap: 30px;
}
nav a {
  position: relative;
  font-size: 13.5px;
  font-weight: 600;
  color: rgba(255,255,255,0.82);
  padding-bottom: 6px;
  cursor: pointer;
  transition: color 0.15s ease;
}
nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  height: 2px;
  width: 100%;
  background: var(--mint);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
nav a:hover, nav a.active { color: #fff; }
nav a:hover::after, nav a.active::after { transform: scaleX(1); }

@media (max-width: 880px) {
  nav { display: none; }
}

/* Featured / hero */
.featured {
  position: relative;
  padding: 56px 0 48px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.featured.featured-category { padding: 44px 0 36px; }
.mesh {
  position: absolute;
  top: -160px;
  right: -180px;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(47,176,217,0.16), rgba(31,111,235,0.05) 55%, transparent 70%);
  animation: drift 14s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
.mesh.mesh-2 {
  top: auto;
  bottom: -200px;
  left: -220px;
  right: auto;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle at 60% 60%, rgba(76,245,224,0.14), transparent 70%);
  animation-duration: 18s;
  animation-delay: -4s;
}
@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-24px, 20px) scale(1.06); }
}
@media (prefers-reduced-motion: reduce) {
  .mesh { animation: none; }
}

.featured .wrap { position: relative; z-index: 1; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 14px;
}
.tag:hover { color: var(--navy); }
.tag .dot {
  width: 7px; height: 7px;
  background: var(--diamond);
  border-radius: 1px;
  transform: rotate(45deg);
  display: inline-block;
}
.featured h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 34px;
  line-height: 1.18;
  font-weight: 700;
  color: var(--navy);
  max-width: 720px;
  margin-bottom: 16px;
}
.featured h1 a:hover { color: var(--blue); }
.featured p.excerpt {
  font-size: 16px;
  color: var(--muted);
  max-width: 620px;
  margin-bottom: 18px;
}
.meta {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--muted);
  font-family: 'IBM Plex Mono', monospace;
}
.meta .ai-chip {
  background: var(--blue-light);
  color: var(--navy);
  padding: 3px 9px;
  border-radius: 100px;
  font-weight: 600;
}

.js-anim .hero-in {
  opacity: 0;
  transform: translateY(14px);
  animation: heroIn 0.7s ease forwards;
}
.js-anim .hero-in.d1 { animation-delay: 0.05s; }
.js-anim .hero-in.d2 { animation-delay: 0.15s; }
.js-anim .hero-in.d3 { animation-delay: 0.25s; }
.js-anim .hero-in.d4 { animation-delay: 0.35s; }
@keyframes heroIn {
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .js-anim .hero-in { animation: none; opacity: 1; transform: none; }
}

/* Grid */
.grid-section { padding: 48px 0 20px; }
.grid-heading {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px 28px;
}
@media (max-width: 880px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid { grid-template-columns: 1fr; } }

.grid-empty {
  font-size: 14px;
  color: var(--muted);
  padding: 8px 0 24px;
}

.card {
  border-radius: 10px;
  padding: 4px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 28px rgba(11, 37, 69, 0.08);
}
.card article {
  height: 100%;
  border-top: 2px solid transparent;
  padding-top: 14px;
  transition: border-color 0.25s ease;
}
.card:hover article { border-top-color: var(--diamond); }
.card h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: 8px;
  transition: color 0.2s ease;
}
.card p {
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .meta { font-size: 11.5px; gap: 10px; }
.card:hover h3 { color: var(--blue); }

/* Selo de ícone por categoria */
.cat-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--blue-light);
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cat-icon svg { width: 16px; height: 16px; }
.card-top, .hero-cat-row, .breadcrumb-cat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.card-top .tag, .hero-cat-row .tag, .breadcrumb-cat-row .tag { margin-bottom: 0; }
.hero-cat-row .cat-icon, .breadcrumb-cat-row .cat-icon { width: 40px; height: 40px; }
.hero-cat-row .cat-icon svg, .breadcrumb-cat-row .cat-icon svg { width: 20px; height: 20px; }

/* Faixa de estatísticas (dados reais do posts.json) */
.stats-strip {
  display: flex;
  gap: 40px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--navy);
}
.stat-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--muted);
}

.js-anim .grid .reveal:nth-child(1) { transition-delay: 0s; }
.js-anim .grid .reveal:nth-child(2) { transition-delay: 0.08s; }
.js-anim .grid .reveal:nth-child(3) { transition-delay: 0.16s; }
.js-anim .grid .reveal:nth-child(4) { transition-delay: 0.24s; }
.js-anim .grid .reveal:nth-child(5) { transition-delay: 0.32s; }
.js-anim .grid .reveal:nth-child(6) { transition-delay: 0.4s; }

/* About / CTA band */
.about {
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 44px 0;
  margin-top: 40px;
}
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 48px;
  align-items: start;
}
.about-text { max-width: 420px; }
.about-text .tag { color: var(--diamond); }
.about-text h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 24px;
  color: var(--navy);
  margin-bottom: 10px;
}
.about-text p { font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.about-cta {
  background: var(--navy);
  color: white;
  font-size: 13px;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 6px;
  white-space: nowrap;
  display: inline-block;
  transition: background 0.2s ease, transform 0.2s ease;
}
.about-cta:hover { background: var(--blue); transform: translateY(-2px); }

.cat-pills {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cat-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  transition: border-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
}
.cat-pill:hover { border-color: var(--diamond); transform: translateX(3px); color: var(--blue); }
.cat-pill .cat-icon { width: 26px; height: 26px; }
.cat-pill .cat-icon svg { width: 14px; height: 14px; }

@media (max-width: 700px) {
  .about-grid { grid-template-columns: 1fr; gap: 28px; }
  .about-text { max-width: none; }
}

/* Footer */
footer {
  background: var(--navy);
  color: rgba(255,255,255,0.55);
  padding: 28px 0;
  font-size: 12.5px;
}
footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
footer .foot-links { display: flex; gap: 20px; }
footer a { transition: color 0.15s ease; }
footer a:hover { color: #fff; }
@media (max-width: 600px) {
  footer .wrap { flex-direction: column; gap: 12px; text-align: center; }
}

/* ---------- Página de notícia individual ---------- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 18px;
}
.breadcrumb a:hover { color: var(--blue); }
.breadcrumb .sep { color: var(--line); }

.post-article { padding: 44px 0 8px; }
.post-article .wrap { max-width: 760px; }
.post-article h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 32px;
  line-height: 1.22;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 16px;
}
.post-article .meta { margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }

.post-body { font-size: 16px; color: var(--ink); }
.post-body p { margin-bottom: 18px; }
.post-body h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px;
  color: var(--navy);
  margin: 32px 0 14px;
}
.post-body ul, .post-body ol { margin: 0 0 18px 20px; }
.post-body li { margin-bottom: 8px; }
.post-body blockquote {
  border-left: 3px solid var(--diamond);
  padding-left: 18px;
  color: var(--muted);
  font-style: italic;
  margin: 24px 0;
}
.draft-notice {
  background: var(--blue-light);
  color: var(--navy);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 28px;
}

.related {
  padding: 12px 0 56px;
  border-top: 1px solid var(--line);
  margin-top: 40px;
}
.related .wrap { max-width: 760px; }

/* ---------- Página de categoria: contador ---------- */
#posts-count::before { content: ""; }
