/* ==========================================================================================================
   Rodapé animado – Prefeitura Municipal de Piraquara · DTI
   Origem: aplicação "Listas de Verificação" (v1.2.0-teste).

   Uso: <link rel="stylesheet" href="css/rodape.css"> + o HTML do <footer class="rodape"> (ver index.html)
        + <script src="js/rodape.js" defer></script> (seletor de temas; opcional).
   Temas (atributo data-tema no <footer>): plano · ondas · bolhas · cardume · algas · barbatana · fundo-mar · rede · rede-pesca
           · agua-viva · correntes · migracao · caranguejo
   Cores: as 4 variáveis abaixo. Se a página já usar as variáveis da aplicação (--pri-escuro, --pri, --pri-claro,
   --filete, --metal), o rodapé as segue automaticamente; senão, vale o padrão institucional (MIV v2.1).
   Acessibilidade: com "reduzir movimento" no sistema (prefers-reduced-motion), tudo fica parado.
   Requer navegador atual (Chrome/Edge 111+, Firefox 113+, Safari 16.4+): usa color-mix, mask e animação de "d".
   ========================================================================================================== */

.rodape {
  --rodape-fundo: var(--pri-escuro, #002362);            /* fundo do rodapé */
  --rodape-filete: var(--filete, var(--pri, #0032C3));   /* linha no topo do rodapé */
  --rodape-destaque: var(--pri-claro, #A0E1FF);          /* links, realces e cor das animações */
  --rodape-brilho: var(--metal, none);                   /* gradiente opcional por cima do fundo (efeito metálico) */

  position: relative; overflow: hidden;
  background: var(--rodape-fundo); background-image: var(--rodape-brilho);
  border-top: 4px solid var(--rodape-filete);
  color: rgba(255,255,255,.82); font-size: 13px;
}
.rodape-inner {
  position: relative; z-index: 1; /* conteúdo acima das animações */
  max-width: 1280px; margin: 0 auto; padding: 22px 24px 26px;
  display: flex; justify-content: space-between; align-items: center; gap: 20px 40px; flex-wrap: wrap;
}
.rodape-pmp { display: flex; flex-direction: column; gap: 2px; line-height: 1.45; }
.rodape-pmp b, .rodape-dti b { font-family: var(--fonte-titulo, "Outfit", "Century Gothic", "Segoe UI", sans-serif); }
.rodape-pmp b { font-size: 14.5px; color: #fff; }
.rodape-pmp a { color: var(--rodape-destaque); font-weight: 600; text-decoration: none; }
.rodape-pmp a:hover { text-decoration: underline; }
.rodape-pmp .nota { margin-top: 6px; font-size: 12px; color: rgba(255,255,255,.6); }
.rodape-dti { display: flex; align-items: center; gap: 14px; text-align: right; line-height: 1.4; }
/* A partir de 900 px o bloco do DTI fica sempre à direita: a coluna da Prefeitura ocupa o resto e o seletor de temas
   quebra em mais linhas quando não couber; o texto do DTI pode quebrar em duas linhas. Abaixo de 900 px os blocos
   voltam a se empilhar quando não cabem lado a lado. */
@media (min-width: 900px) {
  .rodape-inner { flex-wrap: nowrap; }
  .rodape-pmp { flex: 1 1 0; min-width: 0; }
  .rodape-dti { flex: 0 1 auto; max-width: 40%; }
}
.rodape-dti img { width: 84px; height: auto; flex: none; }
.rodape-dti small { display: block; font-size: 12px; color: rgba(255,255,255,.6); }
.rodape-dti b { color: var(--rodape-destaque); font-size: 14px; }
@media print { .rodape { display: none !important; } }

/* Mascote boia em todos os temas animados */
.rodape:not([data-tema="plano"]) .rodape-dti img { animation: rd-boiar 5s ease-in-out infinite; }
@keyframes rd-boiar { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-3px) rotate(-1.5deg); } }

/* ---------- Seletor de tema ---------- */
.rodape .tema { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 12px; color: rgba(255,255,255,.6); }
.rodape .tema-opcoes { display: inline-flex; flex-wrap: wrap; padding: 2px; border-radius: 16px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); }
.rodape .tema-opcoes button {
  border: 0; background: none; color: rgba(255,255,255,.75); font: inherit; font-weight: 600;
  padding: 3px 12px; border-radius: 99px; cursor: pointer;
}
.rodape .tema-opcoes button[aria-pressed="true"] { background: var(--rodape-destaque); color: var(--rodape-fundo); }
.rodape .tema-opcoes button:focus-visible { outline: 2px solid var(--rodape-destaque); outline-offset: 2px; }

/* ---------- Seletor de cores (paletas): uma bolinha por paleta, com a cor escura e a de destaque ---------- */
.rodape .tema-cores { display: flex; flex-wrap: wrap; max-width: 640px; }
.rodape .cores-nome { order: 2; color: rgba(255,255,255,.75); font-weight: 600; }
.rodape .cores-opcoes { order: 3; flex-basis: 100%; margin-top: 2px; display: inline-flex; flex-wrap: wrap; gap: 6px; }
.rodape .cores-opcoes button {
  width: 22px; height: 22px; border-radius: 50%; cursor: pointer; padding: 0;
  border: 2px solid rgba(255,255,255,.35); background: linear-gradient(135deg, var(--a) 0 50%, var(--b) 50% 100%);
  transition: transform .15s, border-color .15s;
}
.rodape .cores-opcoes button:hover { transform: scale(1.12); }
.rodape .cores-opcoes button[aria-pressed="true"] { border-color: #fff; box-shadow: 0 0 0 2px var(--rodape-destaque); }
.rodape .cores-opcoes button:focus-visible { outline: 2px solid var(--rodape-destaque); outline-offset: 3px; }

/* ---------- Tema "ondas": faixa com 3 ondas na base, por toda a largura ---------- */
.rodape-ondas {
  display: none; position: absolute; left: 0; right: 0; bottom: 8px; height: 60px; pointer-events: none; opacity: .1;
  background: var(--rodape-destaque); /* a cor vem da variável; o desenho das ondas é a máscara */
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 60'%3E%3Cpath d='M0 14 q10 -8 20 0 t20 0 M0 30 q10 -8 20 0 t20 0 M0 46 q10 -8 20 0 t20 0' fill='none' stroke='%23000' stroke-width='5' stroke-linecap='round'/%3E%3C/svg%3E"), linear-gradient(90deg, rgba(0,0,0,.4), #000 50%);
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 60'%3E%3Cpath d='M0 14 q10 -8 20 0 t20 0 M0 30 q10 -8 20 0 t20 0 M0 46 q10 -8 20 0 t20 0' fill='none' stroke='%23000' stroke-width='5' stroke-linecap='round'/%3E%3C/svg%3E"), linear-gradient(90deg, rgba(0,0,0,.4), #000 50%);
  -webkit-mask-size: 40px 60px, 100% 100%; mask-size: 40px 60px, 100% 100%;
  -webkit-mask-repeat: repeat-x, no-repeat; mask-repeat: repeat-x, no-repeat;
  -webkit-mask-composite: source-in; mask-composite: intersect;
  animation: rd-mar 30s linear infinite;
}
.rodape[data-tema="ondas"] .rodape-ondas { display: block; }
@keyframes rd-mar { to { -webkit-mask-position: -40px 0, 0 0; mask-position: -40px 0, 0 0; } }

/* ---------- Tema "bolhas": bolhas sobem devagar na lateral direita (perto do mascote) ---------- */
.rodape-bolhas { display: none; position: absolute; top: 0; bottom: 0; right: 0; width: min(300px, 45%); pointer-events: none; }
.rodape[data-tema="bolhas"] .rodape-bolhas:not(.bolhas-fundo) { display: block; }
.rodape-bolhas span {
  /* --x posição · --t tamanho · --d duração · --a atraso · --y altura quando parada (reduzir movimento) */
  position: absolute; bottom: -14px; left: var(--x); width: var(--t); height: var(--t); border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--rodape-destaque) 40%, transparent);
  background: radial-gradient(circle at 32% 30%, rgba(255,255,255,.45) 0 12%, color-mix(in srgb, var(--rodape-destaque) 12%, transparent) 45%, transparent 70%);
  opacity: 0; animation: rd-bolha var(--d) ease-in infinite var(--a);
}
@keyframes rd-bolha {
  0%   { transform: translate(0, 0); opacity: 0; }
  12%  { opacity: .85; }
  35%  { transform: translate(5px, -70px); }
  65%  { transform: translate(-4px, -140px); opacity: .7; }
  100% { transform: translate(3px, -210px); opacity: 0; }
}

/* ---------- Tema "cardume": cardumes atravessam da direita para a esquerda ---------- */
.rodape-cardume { display: none; position: absolute; inset: 0; pointer-events: none; opacity: .2; color: var(--rodape-destaque); }
.rodape[data-tema="cardume"] .rodape-cardume { display: block; }
.rodape-cardume .cardume {
  /* --y profundidade · --d duração · --a atraso · --e escala · --x posição quando parado */
  position: absolute; top: var(--y); left: 105%; width: 80px; height: 40px; transform: scale(var(--e, 1));
  animation: rd-nadar var(--d) linear infinite var(--a);
}
.rodape-cardume .cardume svg { position: absolute; width: 20px; height: 10px; fill: currentColor; animation: rd-balancar 2.6s ease-in-out infinite; }
.rodape-cardume .cardume svg:nth-child(2n) { animation-delay: -1.3s; }
.rodape-cardume .cardume svg:nth-child(3n) { animation-delay: -.7s; }
@keyframes rd-nadar { from { left: 105%; } to { left: -12%; } }
@keyframes rd-balancar { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }

/* ---------- Tema "algas": fundo do mar com algas que ondulam, estrela-do-mar e concha ---------- */
.rodape-algas { display: none; position: absolute; left: 0; right: 0; bottom: 0; height: 90px; pointer-events: none; opacity: .22; color: var(--rodape-destaque); }
.rodape[data-tema="algas"] .rodape-algas { display: block; }
.rodape-algas svg { position: absolute; bottom: 0; fill: currentColor; }
.rodape-algas .areia { left: 0; width: 100%; height: 14px; }
.rodape-algas .alga {
  /* --x posição · --h altura · --d duração · --a atraso */
  left: var(--x); width: calc(var(--h) * .3); height: var(--h); bottom: 4px; overflow: visible;
  transform-origin: 50% 100%; animation: rd-correnteza var(--d) ease-in-out infinite var(--a);
}
/* a folha ondula: o corpo curva e a ponta se mexe mais que a base. As 3 formas precisam ter os mesmos comandos. */
.rodape-algas .alga path { animation: rd-ondular calc(var(--d) * .7) ease-in-out infinite var(--a); }
.rodape-algas .enfeite { left: var(--x); bottom: 6px; width: var(--t); height: var(--t); }
@keyframes rd-correnteza { 0%, 100% { transform: rotate(-8deg) skewX(-5deg); } 50% { transform: rotate(8deg) skewX(5deg); } }
@keyframes rd-ondular {
  0%, 50%, 100% { d: path("M5 70C-1 58 13 48 5 36C-1 25 11 14 8 1C16 14 8 25 14 36C20 48 8 58 14 70Z"); }
  25% { d: path("M5 70C1 58 15 50 9 37C4 26 17 15 16 2C22 16 14 26 17 37C22 50 10 58 14 70Z"); }
  75% { d: path("M5 70C-3 57 9 47 2 35C-5 24 3 13 0 2C8 13 2 24 9 35C17 47 7 58 14 70Z"); }
}

/* ---------- Tema "barbatana": linha d'água e uma barbatana que passa a cada 28 s ---------- */
.rodape-barbatana { display: none; position: absolute; left: 0; right: 0; bottom: 18px; height: 46px; pointer-events: none; color: var(--rodape-destaque); overflow: hidden; }
.rodape[data-tema="barbatana"] .rodape-barbatana { display: block; }
.rodape-barbatana .agua {
  position: absolute; left: 0; right: 0; bottom: 0; height: 14px; opacity: .14; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 14'%3E%3Cpath d='M0 7 q10 -6 20 0 t20 0' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") 0 0 / 40px 14px repeat-x;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 14'%3E%3Cpath d='M0 7 q10 -6 20 0 t20 0' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") 0 0 / 40px 14px repeat-x;
  animation: rd-mar-linha 6s linear infinite;
}
.rodape-barbatana .aleta {
  position: absolute; bottom: 6px; left: 108%; width: 36px; height: 30px; fill: currentColor; opacity: .3;
  animation: rd-rondar 28s linear infinite -9s, rd-boiar-aleta 3s ease-in-out infinite;
}
@keyframes rd-mar-linha { to { -webkit-mask-position: -40px 0; mask-position: -40px 0; } }
@keyframes rd-rondar { 0% { left: 108%; } 55% { left: -8%; } 100% { left: -8%; } } /* atravessa e espera fora da tela */
@keyframes rd-boiar-aleta { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(2px) rotate(-2deg); } }

/* ---------- Tema "fundo-mar": cardume + algas + bolhas saindo das algas, cada um mais suave ---------- */
.rodape[data-tema="fundo-mar"] .rodape-cardume,
.rodape[data-tema="fundo-mar"] .rodape-algas,
.rodape[data-tema="fundo-mar"] .bolhas-fundo { display: block; }
.rodape[data-tema="fundo-mar"] .rodape-cardume { opacity: .15; }
.rodape[data-tema="fundo-mar"] .rodape-cardume .cardume:last-child { display: none; }
.rodape[data-tema="fundo-mar"] .rodape-algas { opacity: .19; }
.rodape-bolhas.bolhas-fundo { left: 0; width: 100%; }  /* bolhas na largura toda, alinhadas às algas */
.rodape-bolhas.bolhas-fundo span { bottom: 10px; }

/* ---------- Tema "rede": malha de nós interligados, como um hub que conecta vários projetos ----------
   Conexões finas, hubs com ondas de sinal, tracejado correndo entre os hubs e pulsos de dados viajando pela malha.
   O SVG (1600 × 400, "slice") cobre a área toda: no computador aparece a faixa do meio, no celular a coluna do meio. */
.rodape-rede { display: none; position: absolute; inset: 0; pointer-events: none; color: var(--rodape-destaque); }
.rodape[data-tema="rede"] .rodape-rede { display: block; }
.rodape-rede svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.rodape-rede .conexoes { fill: none; stroke: currentColor; stroke-width: 1; opacity: .1; }
.rodape-rede .nos circle { fill: currentColor; opacity: .26; animation: rd-piscar 6s ease-in-out infinite var(--a); }
.rodape-rede .hubs circle { fill: var(--rodape-fundo); stroke: currentColor; stroke-width: 1.5; opacity: .4; }
.rodape-rede .hubs .miolo { fill: currentColor; stroke: none; opacity: .75; }
.rodape-rede .hubs .onda { fill: none; opacity: 0; transform-box: fill-box; transform-origin: center; animation: rd-sinal 4s ease-out infinite var(--a); }
.rodape-rede .pulsos { opacity: .55; }
.rodape-rede .pulso { fill: color-mix(in srgb, currentColor 55%, #fff); filter: drop-shadow(0 0 3px currentColor); }
@keyframes rd-piscar { 0%, 100% { opacity: .2; } 50% { opacity: .45; } }
@keyframes rd-sinal { 0% { transform: scale(1); opacity: .45; } 100% { transform: scale(3.6); opacity: 0; } }


/* ---------- Tema "rede-pesca": rede de pesca com nós e boias, balançando na correnteza ----------
   Malha de losangos (nós desenhados com marker-mid), boias que sobem e descem e um cardume que passa por trás. */
.rodape-rede-pesca { display: none; position: absolute; inset: 0; pointer-events: none; color: var(--rodape-destaque); }
.rodape[data-tema="rede-pesca"] .rodape-rede-pesca { display: block; }
.rodape-rede-pesca > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.rodape-rede-pesca .malha { transform-origin: 50% 0; animation: rd-balanco 11s ease-in-out infinite; }
.rodape-rede-pesca .fios { fill: none; stroke: currentColor; stroke-opacity: .12; stroke-width: 1.1; stroke-linejoin: round; }
.rodape-rede-pesca marker circle { fill: currentColor; fill-opacity: .3; }
.rodape-rede-pesca .boia {
  fill: currentColor; fill-opacity: .12; stroke: currentColor; stroke-opacity: .35; stroke-width: 1.5;
  transform-box: fill-box; transform-origin: 50% 100%; animation: rd-boia 4s ease-in-out infinite var(--a);
}
.rodape-rede-pesca .peixes { position: absolute; top: 46%; left: 105%; width: 70px; height: 30px; opacity: .22; animation: rd-atravessar 34s linear infinite -12s; }
.rodape-rede-pesca .peixes svg { position: absolute; width: 20px; height: 10px; fill: currentColor; animation: rd-balancar 2.6s ease-in-out infinite; }
.rodape-rede-pesca .peixes svg:nth-child(2n) { animation-delay: -1.3s; }
@keyframes rd-balanco { 0%, 100% { transform: translate(0, 0) skewX(0deg); } 50% { transform: translate(-14px, 6px) skewX(1.5deg); } }
@keyframes rd-boia { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-4px) rotate(4deg); } }
@keyframes rd-atravessar { 0% { left: 105%; } 60% { left: -10%; } 100% { left: -10%; } } /* atravessa e espera fora da tela */

/* ---------- Tema "agua-viva": águas-vivas (hubs) cujos tentáculos tocam pontos de plâncton (projetos) ----------
   O corpo pulsa, os tentáculos ondulam e um impulso de luz desce por eles; o ponto tocado emite um sinal. */
.rodape-agua-viva { display: none; position: absolute; inset: 0; pointer-events: none; color: var(--rodape-destaque); }
.rodape[data-tema="agua-viva"] .rodape-agua-viva { display: block; }
.rodape-agua-viva svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.rodape-agua-viva .plancton { animation: rd-deriva 18s ease-in-out infinite alternate; }
.rodape-agua-viva .plancton circle { fill: currentColor; opacity: .18; animation: rd-piscar 7s ease-in-out infinite var(--a); }
.rodape-agua-viva .medusa { animation: rd-medusa 8s ease-in-out infinite; }
.rodape-agua-viva .m2 { animation-duration: 7s; animation-delay: -3s; }
.rodape-agua-viva .sino { transform-box: fill-box; transform-origin: 50% 100%; animation: rd-pulsar 3.2s ease-in-out infinite; }
.rodape-agua-viva .sino .corpo { fill: currentColor; fill-opacity: .1; stroke: currentColor; stroke-opacity: .38; stroke-width: 1.5; }
.rodape-agua-viva .sino .dobra, .rodape-agua-viva .sino .borda { fill: none; stroke: currentColor; stroke-opacity: .3; stroke-width: 1.2; }
.rodape-agua-viva .tentaculos { transform-box: fill-box; transform-origin: 50% 0; animation: rd-tentaculos 6s ease-in-out infinite; }
.rodape-agua-viva .fios path { fill: none; stroke: currentColor; stroke-opacity: .2; stroke-width: 1.2; }
.rodape-agua-viva .brilho path {
  fill: none; stroke: color-mix(in srgb, currentColor 50%, #fff); stroke-width: 2.2; stroke-linecap: round;
  stroke-dasharray: 8 100; stroke-dashoffset: 8; filter: drop-shadow(0 0 3px currentColor);
  animation: rd-impulso 6s ease-in infinite var(--a);
}
.rodape-agua-viva .projeto .ponto { fill: currentColor; opacity: .45; }
.rodape-agua-viva .projeto .sinal {
  fill: none; stroke: currentColor; stroke-width: 1.5; opacity: 0;
  transform-box: fill-box; transform-origin: center; animation: rd-toque 6s ease-out infinite var(--a);
}
@keyframes rd-deriva { to { transform: translateY(-16px); } }
@keyframes rd-medusa { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes rd-pulsar { 0%, 100% { transform: scale(1, 1); } 35% { transform: scale(1.07, .88); } 60% { transform: scale(.98, 1.03); } }
@keyframes rd-tentaculos { 0%, 100% { transform: rotate(-2deg) skewX(-3deg); } 50% { transform: rotate(2deg) skewX(3deg); } }
@keyframes rd-impulso { 0% { stroke-dashoffset: 8; } 55%, 100% { stroke-dashoffset: -100; } } /* desce do corpo até o ponto */
@keyframes rd-toque { 0%, 52% { transform: scale(1); opacity: 0; } 56% { opacity: .7; } 85%, 100% { transform: scale(3.2); opacity: 0; } }

/* ---------- Tema "correntes": correntes marítimas ligando ilhas e portos (projetos) ----------
   Rotas tracejadas correndo; portos emitindo sinal; um barquinho seguindo cada rota. */
.rodape-correntes { display: none; position: absolute; inset: 0; pointer-events: none; color: var(--rodape-destaque); }
.rodape[data-tema="correntes"] .rodape-correntes { display: block; }
.rodape-correntes svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.rodape-correntes .rotas { fill: none; stroke: currentColor; stroke-opacity: .22; stroke-width: 1.6; stroke-dasharray: 5 7; animation: rd-rota 2.4s linear infinite; }
.rodape-correntes .ilha { fill: currentColor; opacity: .28; }
.rodape-correntes .porto .sinal {
  fill: none; stroke: currentColor; stroke-width: 1.4; opacity: 0;
  transform-box: fill-box; transform-origin: center; animation: rd-sinal 5s ease-out infinite var(--a);
}
.rodape-correntes .barcos { opacity: .45; }
.rodape-correntes .barco { fill: currentColor; }
@keyframes rd-rota { to { stroke-dashoffset: -24; } }

/* ---------- Tema "migracao": cardumes vindos de todas as bordas, por correntes que se juntam até um recife ----------
   As correntes correm em direção ao recife (o ponto de encontro, no centro); cada cardume nada em formação pela sua
   rota, os pontos de encontro piscam e o recife emite sinais e solta bolhas. */
.rodape-migracao { display: none; position: absolute; inset: 0; pointer-events: none; color: var(--rodape-destaque); }
.rodape[data-tema="migracao"] .rodape-migracao { display: block; }
.rodape-migracao svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.rodape-migracao .fluxo { fill: none; stroke: currentColor; stroke-opacity: .2; stroke-width: 1.3; stroke-dasharray: 2 10; animation: rd-rota 1.8s linear infinite; }
.rodape-migracao .encontro .ponto { fill: currentColor; opacity: .5; }
.rodape-migracao .sinal {
  fill: none; stroke: currentColor; stroke-width: 1.4; opacity: 0;
  transform-box: fill-box; transform-origin: center; animation: rd-sinal 6s ease-out infinite var(--a);
}
.rodape-migracao .coral { fill: none; stroke: currentColor; stroke-opacity: .35; stroke-width: 3; stroke-linecap: round; }
.rodape-migracao .rocha { fill: currentColor; opacity: .3; }
.rodape-migracao .bolha { fill: none; stroke: currentColor; stroke-opacity: .5; animation: rd-subir var(--d) ease-in infinite var(--a); }
.rodape-migracao .cardumes { opacity: .4; }
.rodape-migracao .nado { fill: currentColor; animation: rd-nadar-cardume 1.6s ease-in-out infinite var(--a); }
@keyframes rd-subir { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-70px); opacity: 0; } }
@keyframes rd-nadar-cardume { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }

/* ---------- Tema "caranguejo": o caranguejo anda até a alga, corta a ponta e sai correndo com ela ----------
   Cena de 24 s; todas as animações usam a mesma duração para ficarem sincronizadas (ver as fases nos keyframes).
   Várias algas (--x posição · --h altura · --d/--a balanço); a cortada é a .alvo (entre as [data-alvo]), e --alga é a
   posição dela: o caranguejo para 48 px antes, com a pinça no caule. O js/rodape.js sorteia outra .alvo a cada volta;
   sem o script, ele corta sempre a mesma (a que vem marcada no HTML). */
.rodape-caranguejo { display: none; position: absolute; inset: 0; pointer-events: none; color: var(--rodape-destaque); --alga: 50%; --ciclo: 24s; }
.rodape[data-tema="caranguejo"] .rodape-caranguejo { display: block; }
.rodape-caranguejo svg { position: absolute; overflow: visible; }
.rodape-caranguejo .areia { left: 0; bottom: 0; width: 100%; height: 14px; fill: currentColor; opacity: .16; }
.rodape-caranguejo .pedra { left: 22%; bottom: 4px; width: 34px; height: 14px; fill: currentColor; opacity: .2; }
.rodape-caranguejo .alga {
  left: var(--x); bottom: 4px; width: calc(var(--h) * .31); height: var(--h); fill: currentColor; opacity: .3;
  transform-origin: 50% 100%; animation: rd-correnteza var(--d, 6s) ease-in-out infinite var(--a, 0s);
}
.rodape-caranguejo .alga .ponta { transform-box: fill-box; transform-origin: 50% 100%; }
.rodape-caranguejo .alga.alvo .ponta { animation: rd-cg-ponta var(--ciclo) linear infinite; }
.rodape-caranguejo .corte { fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; opacity: 0; transform-box: fill-box; transform-origin: center; }
.rodape-caranguejo .alga.alvo .corte { animation: rd-cg-corte var(--ciclo) linear infinite; }

.rodape-caranguejo .caranguejo {
  bottom: 3px; left: -70px; width: 64px; height: 43px; opacity: .65;
  animation: rd-cg-trajeto var(--ciclo) linear infinite;
}
.rodape-caranguejo .caranguejo .corpo { fill: currentColor; fill-opacity: .25; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.rodape-caranguejo .caranguejo .traco { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.rodape-caranguejo .caranguejo .olho { fill: currentColor; }
.rodape-caranguejo .pernas-a, .rodape-caranguejo .pernas-b { transform-box: fill-box; transform-origin: 50% 0; }
.rodape-caranguejo .pernas-a { animation: rd-cg-passo-a var(--ciclo) linear infinite; }
.rodape-caranguejo .pernas-b { animation: rd-cg-passo-b var(--ciclo) linear infinite; }
.rodape-caranguejo .pinca { transform-box: fill-box; transform-origin: 0 100%; animation: rd-cg-pinca var(--ciclo) linear infinite; }
.rodape-caranguejo .levada { fill: currentColor; fill-opacity: .55; opacity: 0; animation: rd-cg-levada var(--ciclo) linear infinite; }
.rodape-caranguejo .susto { fill: currentColor; font: 700 13px var(--fonte-titulo, "Outfit", sans-serif); opacity: 0; animation: rd-cg-susto var(--ciclo) linear infinite; }
.rodape-caranguejo .pressa { fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; opacity: 0; animation: rd-cg-pressa var(--ciclo) linear infinite; }

@keyframes rd-cg-trajeto {
  0% { left: -70px; transform: translateY(0); }
  32%, 50% { left: calc(var(--alga) - 48px); transform: translateY(0); }
  51.5% { transform: translateY(-7px); }
  53% { left: calc(var(--alga) - 48px); transform: translateY(0); }
  /* O reinício salta entre duas posições fora da tela; não interpola o retorno. */
  61%, 100% { left: calc(100% + 70px); }
}
@keyframes rd-cg-passo-a { 0%, 32.01%, 52.99%, 61.01%, 100% { transform: rotate(0); } 0%, 2%, 4%, 6%, 8%, 10%, 12%, 14%, 16%, 18%, 20%, 22%, 24%, 26%, 28%, 30%, 53%, 54%, 55%, 56%, 57%, 58%, 59%, 60% { transform: rotate(14deg); } 1%, 3%, 5%, 7%, 9%, 11%, 13%, 15%, 17%, 19%, 21%, 23%, 25%, 27%, 29%, 31%, 53.5%, 54.5%, 55.5%, 56.5%, 57.5%, 58.5%, 59.5%, 60.5% { transform: rotate(-10deg); } }
@keyframes rd-cg-passo-b { 0%, 32.01%, 52.99%, 61.01%, 100% { transform: rotate(0); } 0%, 2%, 4%, 6%, 8%, 10%, 12%, 14%, 16%, 18%, 20%, 22%, 24%, 26%, 28%, 30%, 53%, 54%, 55%, 56%, 57%, 58%, 59%, 60% { transform: rotate(-14deg); } 1%, 3%, 5%, 7%, 9%, 11%, 13%, 15%, 17%, 19%, 21%, 23%, 25%, 27%, 29%, 31%, 53.5%, 54.5%, 55.5%, 56.5%, 57.5%, 58.5%, 59.5%, 60.5% { transform: rotate(10deg); } }
@keyframes rd-cg-pinca { 0%, 33.99%, 49.01%, 100% { transform: rotate(0); } 34%, 38%, 42%, 46% { transform: rotate(-32deg); } 36%, 40%, 44%, 48% { transform: rotate(0); } }
@keyframes rd-cg-ponta { 0%, 49.9% { transform: scaleY(1); opacity: 1; } 50%, 72% { transform: scaleY(0); opacity: 0; } 90%, 100% { transform: scaleY(1); opacity: 1; } }
@keyframes rd-cg-corte { 0%, 49.5% { opacity: 0; transform: scale(.4); } 50% { opacity: 1; transform: scale(1); } 53%, 100% { opacity: 0; transform: scale(1.6); } }
@keyframes rd-cg-levada { 0%, 49.9% { opacity: 0; } 50%, 99.9% { opacity: 1; } 100% { opacity: 0; } }
@keyframes rd-cg-susto { 0%, 49.9% { opacity: 0; transform: translateY(0); } 50.5% { opacity: 1; transform: translateY(-3px); } 56% { opacity: 1; } 58%, 100% { opacity: 0; transform: translateY(-3px); } }
@keyframes rd-cg-pressa { 0%, 52.9% { opacity: 0; } 53.5%, 60.5% { opacity: 1; } 61%, 100% { opacity: 0; } }

/* ---------- Temas de malha (rede, rede-pesca, agua-viva, correntes, migracao): menos destaque atrás dos textos ----------
   A partir de 900 px o desenho esmaece nas laterais, onde ficam o texto da Prefeitura e o do DTI. */
@media (min-width: 900px) {
  .rodape-rede, .rodape-rede-pesca, .rodape-agua-viva, .rodape-correntes, .rodape-migracao {
    -webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,.3) 10%, #000 38%, #000 66%, rgba(0,0,0,.35) 88%);
            mask-image: linear-gradient(90deg, rgba(0,0,0,.3) 10%, #000 38%, #000 66%, rgba(0,0,0,.35) 88%);
  }
}

/* ---------- Reduzir movimento: tudo parado ---------- */
@media (prefers-reduced-motion: reduce) {
  .rodape-ondas, .rodape-dti img { animation: none !important; }
  .rodape-bolhas span { animation: none; opacity: .6; bottom: var(--y); }
  .rodape-cardume .cardume { animation: none; left: var(--x); }
  .rodape-cardume .cardume svg { animation: none; }
  .rodape-algas .alga, .rodape-algas .alga path, .rodape-barbatana .agua { animation: none; }
  .rodape-barbatana .aleta { animation: none; left: 72%; }
  .rodape-rede .nos circle, .rodape-rede .hubs .onda { animation: none; }
  .rodape-rede .pulsos { display: none; } /* pulsos usam animação SVG (SMIL), que o CSS não pausa: escondidos */
  .rodape-rede-pesca .malha, .rodape-rede-pesca .boia, .rodape-rede-pesca .peixes svg,
  .rodape-agua-viva *, .rodape-correntes .rotas, .rodape-correntes .porto * { animation: none; }
  .rodape-rede-pesca .peixes { animation: none; left: 58%; }
  .rodape-agua-viva .brilho, .rodape-correntes .barcos { display: none; } /* barcos também usam SMIL */
  .rodape-migracao * { animation: none; }
  .rodape-migracao .cardumes, .rodape-migracao .bolha { display: none; } /* cardumes usam SMIL */
  .rodape-caranguejo * { animation: none !important; }
  .rodape-caranguejo .caranguejo { left: calc(var(--alga) - 48px); } /* parado ao lado da alga */
}

/* ---------- Celular: mascote à esquerda do texto, virado para ele ---------- */
@media (max-width: 640px) {
  .rodape-inner { padding: 20px 16px 24px; }
  .rodape-dti { text-align: left; flex-direction: row-reverse; justify-content: flex-end; }
  .rodape-dti img { scale: -1 1; } /* "scale" não conflita com o "transform" da animação de boiar */
}
