/* ===========================
   Tema / Cores
   =========================== */
:root {
  /* base (dark por padrão) */
  --bg: #0f172a;            /* slate-900 */
  --bg-soft: #111827;       /* gray-900 */
  --text: #e5e7eb;          /* gray-200 */
  --text-dim: #cbd5e1;      /* slate-300 */
  --card: #111827cc;
  --border: #1f2937;        /* gray-800 */
  --accent: #38bdf8;        /* sky-400 */
  --accent-2: #22d3ee;      /* cyan-400 */
  --muted: #94a3b8;         /* slate-400 */
  --link: #7dd3fc;          /* sky-300 */
  --shadow: 0 20px 50px rgba(0, 0, 0, .35);

  color-scheme: dark; /* ajuda inputs/ua a escolherem tema */
}

/* Fallback automático pelo sistema (aplica claro quando não há override) */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f8fafc; --bg-soft: #ffffff;
    --text: #0f172a; --text-dim: #334155;
    --card: #ffffff; --border: #e2e8f0;
    --accent: #0284c7; --accent-2: #0891b2;
    --muted: #475569; --link: #0369a1;
    --shadow: 0 10px 25px rgba(2, 8, 23, .08);

    color-scheme: light;
  }
}

/* Overrides explícitos para o botão de tema */
html[data-theme="light"] {
  --bg: #f8fafc; --bg-soft: #ffffff;
  --text: #0f172a; --text-dim: #334155;
  --card: #ffffff; --border: #e2e8f0;
  --accent: #0284c7; --accent-2: #0891b2;
  --muted: #475569; --link: #0369a1;
  --shadow: 0 10px 25px rgba(2, 8, 23, .08);

  color-scheme: light;
}
html[data-theme="dark"] {
  --bg: #0f172a; --bg-soft: #111827;
  --text: #e5e7eb; --text-dim: #cbd5e1;
  --card: #111827cc; --border: #1f2937;
  --accent: #38bdf8; --accent-2: #22d3ee;
  --muted: #94a3b8; --link: #7dd3fc;
  --shadow: 0 20px 50px rgba(0, 0, 0, .35);

  color-scheme: dark;
}

/* ===========================
   Reset/Globais
   =========================== */
* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: linear-gradient(120deg, var(--bg) 0%, var(--bg-soft) 100%);
}

img { max-width: 100%; height: auto; }

/* Scroll suave quando permitido */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* Âncoras não ficarem sob o header sticky */
:where(section, h1, h2, h3, h4, h5, h6) { scroll-margin-top: 84px; }

.container { max-width: 1100px; margin: 0 auto; padding: 24px; }

/* ===========================
   Header “vidrado” + Nav
   =========================== */
header {
  position: sticky;
  top: 0;
  z-index: 50;

  backdrop-filter: saturate(1.2) blur(8px);
  -webkit-backdrop-filter: saturate(1.2) blur(8px);

  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--bg) 85%, transparent),
    color-mix(in srgb, var(--bg) 50%, transparent)
  );
  border-bottom: 1px solid var(--border);
}

/* Fallback sem backdrop-filter */
@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
  header { background: color-mix(in srgb, var(--bg) 92%, transparent); }
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}
.brand .logo {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: radial-gradient(circle at 30% 30%, var(--accent), var(--accent-2));
  box-shadow: var(--shadow);
}
.brand strong { font-weight: 700; letter-spacing: .2px; }

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.links a {
  color: var(--text);
  opacity: .9;
  padding: 8px 10px;
  text-decoration: none;
  border-radius: 10px;
}
.links a:hover,
.links a.active {
  color: var(--text);
  opacity: 1;
  background: rgba(148, 163, 184, .12);
}
.links a:focus-visible {
  background: rgba(148, 163, 184, .12);
  color: var(--text);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-toggle {
  padding: 8px 12px;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}
.theme-toggle:hover {
  color: var(--text);
  border-color: var(--accent);
}

/* ===========================
   Botões
   =========================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  padding: 10px 14px;
  border: 0;
  border-radius: 12px;

  color: #fff;
  text-decoration: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: var(--shadow);
  cursor: pointer;

  transition:
    background .2s ease,
    transform .2s ease,
    box-shadow .2s ease,
    color .2s ease,
    border-color .2s ease;
}
.btn:hover {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  transform: translateY(-2px);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 30%, transparent);
}
.btn:active { transform: translateY(-1px); }
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn.ghost {
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent);
  box-shadow: none;
}
.btn.ghost:hover {
  background: rgba(148, 163, 184, .12);
  transform: translateY(-2px);
}
@supports (background: color-mix(in srgb, red 10%, transparent)) {
  .btn.ghost:hover { background: color-mix(in srgb, var(--text) 12%, transparent); }
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
/* ===========================
   Hero / Layouts / Cards
   =========================== */
.hero {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 28px;
  align-items: center;
  padding: 42px 0;
}
.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.15;
}
.hero p { margin: 0 0 18px; color: var(--text-dim); }
.hero .badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  margin-bottom: 14px;
  padding: 6px 10px;
  border: 1px dashed var(--border);
  border-radius: 999px;

  font-size: 14px;
  color: var(--muted);
}
.hero .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.grid { display: grid; gap: 16px; }
.cards { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 6px; }
.card p { margin: 0 0 10px; color: var(--text-dim); }

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 14px;
  color: var(--muted);
}

section { padding: 28px 0; }
section h2 { margin: 0 0 14px; font-size: 22px; }

.footer {
  padding: 28px 0;
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--muted);
}

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;

  font-size: 14px;
  color: var(--muted);
}

/* Responsivo */
@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; text-align: left; }
}
.profile-pic {
  display: block;
  margin: 0 auto 20px;

  width: 300px;
  height: 300px;
  border: 3px solid var(--accent);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow);
}
@media (max-width: 640px) {
  .profile-pic { width: 200px; height: 200px; }
}

/* ===========================
   Código: blocos <pre> com botão copiar
   =========================== */
pre {
  padding: 10px 14px;
  border-radius: 6px;
  background-color: #1e1e1e;
  color: #d4d4d4;

  font-family: "Fira Code","Consolas",monospace;
  font-size: 14px;
  line-height: 1.5;

  white-space: pre-wrap;
  tab-size: 2;
  overflow-x: auto;
}

.codeblok { position: relative; }

/* Botão copiar */
.codeblok .copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;

  display: inline-flex;
  align-items: center;
  gap: 6px;

  padding: 6px 8px;
  border: 1px solid #30363d;
  border-radius: 8px;

  background: #0d1117;
  color: #e6edf3;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  opacity: .9;
}
.codeblok .copy-btn:hover { opacity: 1; }
.codeblok .copy-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.codeblok .copy-btn svg { width: 14px; height: 14px; }

/* Selo “copiado!” */
.codeblok .copied-badge {
  position: absolute;
  top: 8px;
  right: 52px;

  display: none;
  align-items: center;
  gap: 6px;

  padding: 6px 8px;
  border: 1px solid #30363d;
  border-radius: 8px;

  background: #0d1117;
  color: #e6edf3;
  font-size: 12px;
}
.codeblok .copied-badge.show { display: inline-flex; }
.codeblok .copied-badge img { width: 14px; height: 14px; display: block; }

/* ===========================
   Código: linhas inline com descrição
   =========================== */
.cmd-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}
.cmd {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  padding: 4px 6px;
  border-radius: 6px;

  background: #1e1e1e;
  color: #d4d4d4;
  font-family: "Fira Code","Consolas",monospace;
  font-size: 14px;
  tab-size: 2;
}
.cmd:hover {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent) inset;
}

/* Botão copiar inline */
.copy-btn-inline {
  display: inline-flex;
  align-items: center;

  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.copy-btn-inline:hover { color: var(--accent); }
.copy-btn-inline:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.cmd button svg { width: 14px; height: 14px; display: block; }

/* Selo “copiado” inline */
.copied-inline {
  display: none;
  align-items: center;
  gap: 6px;

  padding: 4px 8px;
  border: 1px solid #30363d;
  border-radius: 8px;

  background: #0d1117;
  color: #e6edf3;
  font-size: 12px;
}
.copied-inline.show { display: inline-flex; }

/* ===========================
   Carrosséis (seções do home)
   =========================== */
#envolvidos { margin-top: 48px; }
#envolvidos h2 { margin-bottom: 14px; }

.carousel-wrap { display: grid; place-items: center; gap: 14px; }

.circle-carousel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 6px;
}
.circle-item {
  position: relative;
  width: 150px;
  height: 150px;
  border: 1px solid var(--border);
  border-radius: 50%;
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow);
}
.circle-link {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  width: 100%;
  height: 100%;
  color: inherit;
  text-decoration: none;
}
.circle-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: contain;
  z-index: 0;
}
.circle-caption {
  position: relative;
  z-index: 1;

  max-width: 90%;
  margin-bottom: 6px;
  padding: 6px 8px;
  border-radius: 6px;

  text-align: center;
  font-size: .85rem;
  font-weight: 600;
  line-height: 1.2;

  background: rgba(0, 0, 0, .55);
}
.circle-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;

  padding: 3px 8px;
  border: 0;
  border-radius: 999px;

  font-size: .72rem;
  color: #fff;

  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: var(--shadow);
}
.circle-item:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.carousel-controls { display: flex; align-items: center; gap: 8px; }
#prevPg, #nextPg {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
#prevPg:hover, #nextPg:hover {
  color: #fff;
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.carousel-note { text-align: center; font-size: .85rem; color: var(--muted); }

/* Mobile: rolagem horizontal */
@media (max-width: 640px) {
  .circle-carousel { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x mandatory; }
  .circle-item { flex: 0 0 70%; scroll-snap-align: center; }
}

/* Publicações */
.pub-carousel {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.pub-carousel::-webkit-scrollbar {
  display: none;
}

.pub-carousel .card { flex: 0 0 33.333%; }
@media (max-width: 800px) {
  .pub-carousel .card { flex: 0 0 80%; }
}

/* Acessibilidade: reduzir movimento */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.pub-carousel .card {
  flex: 0 0 33.333%;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pub-carousel .card:hover {
  transform: translateY(-6px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}


/* ===========================
   Botão: voltar ao topo
   =========================== */
#btn-top {
  position: fixed;
  right: clamp(16px, 2.2vw, 24px);
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 1000;

  display: grid;
  place-items: center;

  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  cursor: pointer;

  color: #fff;
  background: linear-gradient(135deg, #0ea5e9, #38bdf8);
  box-shadow:
    0 0 12px rgba(56, 189, 248, 0.6),
    0 4px 15px rgba(0, 0, 0, 0.3);

  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(.9);
  transition: opacity .3s ease, transform .3s ease, visibility 0s .3s;
}
/* ===========================
   Botão: voltar ao topo (estados)
   =========================== */
/* Estado visível */
#btn-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  animation: pulse 2.5s infinite;
}
/* Hover */
#btn-top:hover {
  box-shadow:
    0 0 20px rgba(56, 189, 248, 0.9),
    0 6px 20px rgba(0, 0, 0, 0.4);
  transform: translateY(-2px) scale(1.08);
}
/* Clique */
#btn-top:active { transform: scale(.95); }

/* Animação de pulso */
@keyframes pulse {
  0%   { box-shadow: 0 0 12px rgba(56, 189, 248, 0.6); }
  50%  { box-shadow: 0 0 22px rgba(56, 189, 248, 0.95); }
  100% { box-shadow: 0 0 12px rgba(56, 189, 248, 0.6); }
}

/* Tooltip do botão */
#btn-top .tooltip {
  position: absolute;
  right: 70px;

  padding: 6px 10px;
  border-radius: 6px;

  background: #0ea5e9;
  color: #fff;
  font-size: .85rem;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);

  opacity: 0;
  transform: translateY(0);
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
}
/* Mostrar tooltip no hover */
#btn-top:hover .tooltip {
  opacity: 1;
  transform: translateY(-2px);
}

/* ===========================
   Carrossel CSS-only (ENV)
   =========================== */
/* ⚠️ Unificar ID: o HTML usa #envolvidos.
   Mantenho alias com #envolvidos por compat, mas ideal é padronizar para #envolvidos. */
#envolvidos, #envolvidos { --gap: 20px; --size: 140px; }

.env-viewport {
  overflow: hidden;
  border-radius: 16px;
}
.env-track {
  display: flex;
  width: 200%;                 /* 2 páginas => 200%. Para 3, use 300% */
  transition: transform .5s ease;
}
.env-page {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
  width: 100%;
  padding: 16px 0;
}

/* Escopo das bolachas do carrossel CSS-only
   (evita sobrescrever .circle-* global) */
.env-page .circle-item {
  display: flex;
  justify-content: center;
}
.env-page .circle-link {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
}
.env-page .circle-thumb {
  width: var(--size);
  height: var(--size);
  border-radius: 999px;
  object-fit: cover;
  box-shadow: 0 12px 24px rgba(0,0,0,.35);
}
.env-page .circle-tag {
  position: absolute;
  top: 8px;
  left: 8px;

  padding: 4px 8px;
  border-radius: 999px;

  background: #0ea5e9;
  color: #fff;
  font-size: .75rem;
}
.env-page .circle-caption {
  margin-top: 10px;
  font-weight: 600;
  opacity: .9;
}

/* Controles */
.env-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}
.env-controls label {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 40px;
  height: 40px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 10px;

  background: transparent;
  cursor: pointer;
  user-select: none;
}

/* Navegação (radios) */
.env-nav { display: none; }

/* Páginas (2 páginas) */
#envp1:checked ~ .env-viewport .env-track { transform: translateX(0); }
#envp2:checked ~ .env-viewport .env-track { transform: translateX(-50%); }

/* Dots (opcional) */
.env-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}
.env-dots label {
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 999px;
}
#envp1:checked ~ .env-dots label[for="envp1"],
#envp2:checked ~ .env-dots label[for="envp2"] { outline: 2px solid currentColor; }

/* Responsivo: 2 colunas no mobile */
@media (max-width: 640px) {
  .env-page { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #envolvidos, #envolvidos { --size: 120px; }
}

.actions--column { display:flex; flex-direction:column; gap:16px; align-items:flex-start; }
.actions__row { display:flex; flex-wrap:wrap; gap:10px; }
.chips--wrap { margin-top:10px; display:flex; flex-wrap:wrap; gap:10px; }
.sr-only-focusable:focus { position:static !important; width:auto; height:auto; padding:.5rem; background:rgba(148,163,184,.12); border-radius:8px; }

#envolvidos .circle-carousel{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:16px;
  align-items:start;
}
@media (max-width: 992px){ #envolvidos .circle-carousel{ grid-template-columns:repeat(2,1fr);} }
@media (max-width: 560px){ #envolvidos .circle-carousel{ grid-template-columns:1fr;} }

/* antes: #prevPg, #nextPg */
#prevPg, #nextPg,
#envolvidosPrev, #envolvidosNext {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
#prevPg:hover, #nextPg:hover,
#envolvidosPrev:hover, #envolvidosNext:hover {
  color: #fff;
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

/* Utilitário para paginação/ocultar itens */
.hidden { display: none !important; }

/* Badge "Atual" — manter visível dentro do círculo */
#envolvidos .circle-tag{
  top: 12px;          /* antes 8px */
  left: 25px;         /* antes 8px */
  z-index: 3;         /* acima da imagem e da legenda */
  white-space: nowrap;
  padding: 4px 9px;
}

/* Badge "Atual" — manter visível dentro do círculo */
#envolvidos .circle-tag{
  top: 12px;          /* antes 8px */
  left: 25px;         /* antes 8px */
  z-index: 3;         /* acima da imagem e da legenda */
  white-space: nowrap;
  padding: 4px 9px;
}

/* ===== Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .35em;
  padding: .18em .55em;
  border-radius: 9999px;
  font: 500 .9rem/1.1 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg, #2d2d2d);
  color: var(--fg, #fff);
  border: 1px solid color-mix(in srgb, var(--bg, #2d2d2d), #000 20%);
  text-decoration: none; /* permite usar <a class="badge"> */
}

/* tamanhos opcionais */
.badge--sm { font-size: .8rem;  padding: .12em .5em; }
.badge--lg { font-size: 1rem;   padding: .28em .75em; }

/* variação contornada (sem fundo) */
.badge--outline { 
  background: transparent; 
  color: var(--bg, #2d2d2d); 
  border-color: currentColor; 
}

/* ===== Temas por ferramenta (cores sugeridas) ===== */
.badge--nextflow  { --bg:#24B064; --fg:#0b1f14; }  /* você já usa #24B064 */
.badge--conda     { --bg:#43B02A; --fg:#0b1f14; }  /* verde conda sugerido */
.badge--docker    { --bg:#2496ED; --fg:#ffffff; }  /* azul docker */
.badge--snakemake { --bg:#6C5CE7; --fg:#ffffff; }  /* roxo confortável */

/* acessibilidade em tema claro */
@media (prefers-color-scheme: light) {
  .badge--nextflow,
  .badge--conda { --fg:#08250f; }
}

.codeStyle {
  background: #2d2d2d;
  border-radius: 6px;
  padding: 3px 6px;
  color: #f8f8f2;           /* melhora o contraste no fundo escuro */
}

/* opcional: para “quadradinho” em várias linhas */
.codeStyle--block {
  display: inline-block;    /* não ocupa a largura toda */
  white-space: pre;         /* preserva quebras de linha/indentação */
  padding: 8px 12px;        /* um pouco mais de respiro */
  line-height: 1.4;
}

.card img.thumb {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 0.8rem;
  object-fit: cover;
}

img {
  max-width: 100%;
  height: auto;
}
