/* ─────────────────────────────────────────────
   CodePiper — main.css
   Apenas estilos que Tailwind não cobre nativamente.
   ─────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,300;0,400;0,500&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700&display=swap');

:root {
  --font-sans: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'DM Mono', 'Fira Code', monospace;
}

body {
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

code, pre, .font-mono {
  font-family: var(--font-mono);
}

/* ── Header scrollado ────────────────────────── */
.site-header {
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}
.dark .site-header {
  background: rgba(3, 7, 18, 0.85);
}
.site-header.scrolled {
  border-color: rgba(0,0,0,0.08);
}
.dark .site-header.scrolled {
  border-color: rgba(255,255,255,0.06);
}

/* ── Mobile menu ─────────────────────────────── */
#navMobile.open {
  display: block;
}

/* ── Animação blob ───────────────────────────── */
@keyframes blob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(30px, -20px) scale(1.1); }
  66%       { transform: translate(-20px, 20px) scale(0.95); }
}
.animate-blob { animation: blob 7s infinite; }
.animation-delay-2000 { animation-delay: 2s; }
.animation-delay-4000 { animation-delay: 4s; }

/* ── Ticker de tecnologias ───────────────────── */
@keyframes ticker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.animate-ticker {
  animation: ticker 30s linear infinite;
  will-change: transform;
}
.animate-ticker:hover { animation-play-state: paused; }

/* ── Prose (blog) ────────────────────────────── */
.prose h1, .prose h2, .prose h3, .prose h4 {
  font-family: var(--font-sans);
  font-weight: 700;
  color: #111827;
  margin-top: 2em;
  margin-bottom: 0.75em;
}
.dark .prose h1, .dark .prose h2, .dark .prose h3, .dark .prose h4 {
  color: #f9fafb;
}
.prose p { margin-bottom: 1.25em; line-height: 1.8; color: #374151; }
.dark .prose p { color: #d1d5db; }
.prose a { color: #2563eb; text-decoration: underline; }
.dark .prose a { color: #60a5fa; }
.prose code {
  font-family: var(--font-mono);
  background: #f3f4f6;
  border-radius: 4px;
  padding: 0.15em 0.4em;
  font-size: 0.875em;
  color: #e11d48;
}
.dark .prose code { background: #1f2937; color: #f472b6; }
.prose pre {
  background: #1e1e2e;
  border-radius: 12px;
  padding: 1.25em 1.5em;
  overflow-x: auto;
  margin: 1.5em 0;
  border: 1px solid rgba(255,255,255,0.08);
}
.prose pre code {
  background: none;
  color: #cdd6f4;
  padding: 0;
  font-size: 0.875em;
  border-radius: 0;
}
.prose blockquote {
  border-left: 4px solid #3b82f6;
  padding-left: 1em;
  color: #6b7280;
  font-style: italic;
  margin: 1.5em 0;
}
.dark .prose blockquote { color: #9ca3af; border-left-color: #2563eb; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5em 0; }
.prose table th, .prose table td {
  padding: 0.5em 1em;
  border: 1px solid #e5e7eb;
  text-align: left;
}
.dark .prose table th, .dark .prose table td { border-color: #374151; }
.prose table th { background: #f9fafb; font-weight: 600; }
.dark .prose table th { background: #1f2937; color: #f9fafb; }
.prose ul { list-style: disc; padding-left: 1.5em; margin-bottom: 1.25em; }
.prose ol { list-style: decimal; padding-left: 1.5em; margin-bottom: 1.25em; }
.prose li { margin-bottom: 0.5em; color: #374151; }
.dark .prose li { color: #d1d5db; }
.prose hr { border: none; border-top: 1px solid #e5e7eb; margin: 2em 0; }
.dark .prose hr { border-top-color: #374151; }

/* ── Balão WhatsApp ──────────────────────────── */
.whatsapp-float {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 999;
  width: 56px;
  height: 56px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}
.whatsapp-float:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 8px 30px rgba(37, 211, 102, 0.5);
}
.whatsapp-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #25D366;
  animation: waPulse 2.5s ease-out infinite;
}
@keyframes waPulse {
  0%   { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.6); opacity: 0; }
}
.whatsapp-tooltip {
  position: absolute;
  right: 68px;
  white-space: nowrap;
  background: rgba(0,0,0,0.8);
  color: #fff;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.whatsapp-float:hover .whatsapp-tooltip {
  opacity: 1;
}

/* ── Code window (hero) ──────────────────────── */
.code-window { transition: transform 0.3s; }
.code-window:hover { transform: translateY(-4px); }

/* ── Counter animado ─────────────────────────── */
.counter { font-variant-numeric: tabular-nums; }

/* ── Barra de progresso de leitura ───────────── */
#reading-progress {
  pointer-events: none;
}

/* ── Ícones de tema — ocultos por padrão até o JS inicializar ── */
/* Evita flash de ambos os ícones antes do bindToggle rodar    */
[data-theme-icon] {
  display: none;
}

/* ── Share portal (dark mode) ────────────────── */
.dark .cp-share-menu-portal {
  background: #1f2937 !important;
  border-color: rgba(255,255,255,0.08) !important;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4) !important;
  color: #e5e7eb !important;
}
.dark .cp-share-menu-portal a,
.dark .cp-share-menu-portal button {
  color: #e5e7eb !important;
}
.dark .cp-share-menu-portal a:hover {
  background: rgba(22,163,74,0.15) !important;
}
.dark .cp-share-menu-portal button:hover {
  background: rgba(255,255,255,0.05) !important;
}
.dark .cp-share-menu-portal [style*="background:#dcfce7"] {
  background: rgba(22,163,74,0.2) !important;
}
.dark .cp-share-menu-portal [style*="background:#f3f4f6"] {
  background: rgba(255,255,255,0.08) !important;
}
.dark .cp-share-menu-portal [style*="background:rgba(0,0,0,0.06)"] {
  background: rgba(255,255,255,0.06) !important;
}