/* ============================================================
   proage.com.br — portfólio da Proage · versão 4 (nov/2026)
   HTML + CSS + v4.js, sem build e sem biblioteca.
   Identidade: Proage Design System (handoff, ago/2026).

   A página tem duas visões do mesmo HTML:
   · MAPA  — a visão inicial. Os logos, com o nome embaixo, ficam
     ligados à marca por fiação e se mexem sozinhos; reagem ao
     mouse, podem ser arrastados e o clique abre o link. Quando
     ninguém mexe, um cursor passeia pelos logos mostrando cada um.
   · LISTA — a árvore empilhada. É o que aparece sem JavaScript
     e pelo botão do rodapé.
   A classe em <html> (is-map / is-list) escolhe a visão.
   ============================================================ */

:root {
  /* --- Tokens Proage --- */
  --blue-500: #0171BA;
  --blue-600: #015E9B;
  --blue-100: #D8EAF7;
  --green-500: #4AAE35;  /* acento gráfico apenas — nunca texto */
  --green-700: #377D26;  /* o único verde AA-seguro para texto */
  --navy-900: #0B2B44;
  --ink: #1B2A3A;
  --body: #3B4754;
  --muted: #5D6B7A;
  --border: #E3E8EE;
  --surface: #FFFFFF;
  --surface-alt: #F5F8FB;

  --font-heading: "Montserrat", sans-serif;
  --font-body: "Source Sans 3", sans-serif;

  --shadow-sm: 0 1px 2px rgb(11 43 68 / 0.06);
  --shadow-md: 0 6px 20px rgb(11 43 68 / 0.10);
  --shadow-lg: 0 14px 34px rgb(11 43 68 / 0.16);
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

* { box-sizing: border-box; }

html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--surface-alt);
  color: var(--body);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ============================================================
   BASE = LISTA
   ============================================================ */

.page {
  position: relative;
  max-width: 620px;
  margin: 0 auto;
  padding: 28px 20px 32px;
}

.fx { display: none; }

.intro { position: relative; }

.brand { margin: 0 0 22px; }

.brand-logo {
  display: block;
  width: 180px;
  height: auto;
}

.bio { margin: 0; }

.bio-lead {
  display: block;
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--body);
}

.bio-main {
  display: block;
  margin-top: 8px;
  font-family: var(--font-heading);
  font-size: clamp(1.375rem, 1rem + 1.6vw, 2rem);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-wrap: balance;
}

.bio-main b { font-weight: 700; }

/* o sublinhado do original, refeito com os quadradinhos do logo */
.bio-main u {
  white-space: nowrap;             /* cada frente fica inteira numa linha, com o sublinhado sem quebra */
  text-decoration: none;
  padding-bottom: 0.1em;
  background: linear-gradient(to right, var(--green-500) 50%, transparent 50%) left bottom / 8px 4px repeat-x;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.legend,
.hint { display: none; }

.portfolio { margin-top: 36px; }

.branch + .branch { margin-top: 28px; }

.tag {
  margin: 0 0 12px;
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 24px;
  color: var(--muted);
}

.tree,
.children {
  display: flex;
  flex-direction: column;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.tree { --thumb: 48px; }

.children {
  --thumb: 40px;
  position: relative;
  margin-top: 12px;
  padding-left: 30px;
}

/* guia tracejada dos subitens (na lista não há fiação animada) */
.children::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 18px;
  width: 4px;
  background: linear-gradient(to bottom, #93C2E1 50%, transparent 50%) left top / 4px 8px repeat-y;
}

.node {
  display: block;
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.node:focus-visible {
  outline: 2px solid var(--blue-500);
  outline-offset: 3px;
}

.card {
  position: relative;
  display: grid;
  grid-template-columns: var(--thumb) minmax(0, 1fr);
  column-gap: 12px;
  align-items: start;
  padding: 12px 14px 14px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  transition: border-color 150ms linear, box-shadow 250ms var(--ease);
}

.children .node,
.children .card { border-radius: 10px; }

.children .card { box-shadow: none; }

.node:hover .card,
.node:focus-visible .card {
  border-color: var(--blue-500);
  box-shadow: var(--shadow-md);
}

.branch--apoio .node:hover .card,
.branch--apoio .node:focus-visible .card { border-color: var(--green-500); }

.thumb {
  display: block;
  width: var(--thumb);
  height: var(--thumb);
  border-radius: 10px;
  object-fit: cover;
}

.children .thumb { border-radius: 8px; }

/* logo que é uma palavra larga (WiRE): aparece inteiro, sem corte */
.node--wide .thumb {
  object-fit: contain;
  border-radius: 0;
}

.txt {
  display: block;
  min-width: 0;
}

.nm {
  display: block;
  padding-right: 22px;
  font-family: var(--font-heading);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.children .nm { font-size: 0.9375rem; }

.ds {
  display: block;
  margin-top: 1px;
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--body);
}

.nt {
  display: block;
  margin-top: 5px;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--muted);
}

/* o "re" de reprojeto em verde — a dupla azul/verde da marca no wordplay */
.re {
  font-weight: 600;
  color: var(--green-700);
}

/* seta de "abre em outra aba" (na lista, no canto do card) */
.go {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 14px;
  height: 14px;
  color: #9AA7B4;
  transition: color 150ms linear, transform 250ms var(--ease);
}

.go svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.node:hover .go,
.node:focus-visible .go {
  color: var(--blue-600);
  transform: translate(2px, -2px);
}

.branch--apoio .node:hover .go,
.branch--apoio .node:focus-visible .go { color: var(--green-700); }

/* O item apoiado não é produto da empresa: na lista o card dele é menor
   e mais apagado que os dos produtos. (Fora do mapa: sem classe ou is-list.) */
:root:not(.is-map) .branch--apoio .tree { --thumb: 32px; }

:root:not(.is-map) .branch--apoio .card {
  column-gap: 10px;
  align-items: center;
  padding: 8px 34px 9px 8px;
  background: transparent;
  box-shadow: none;
}

:root:not(.is-map) .branch--apoio .thumb { border-radius: 7px; }

:root:not(.is-map) .branch--apoio .nm {
  padding-right: 0;
  font-size: 0.875rem;
}

:root:not(.is-map) .branch--apoio .nt {
  margin-top: 1px;
  font-size: 0.75rem;
}

:root:not(.is-map) .branch--apoio .go {
  top: 50%;
  margin-top: -7px;
}

.node--root,
.label,
.ghost,
.chip { display: none; }

.footer {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
  margin-top: 36px;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--muted);
}

.view-toggle {
  padding: 7px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--blue-600);
  font: 600 0.8125rem/1.2 var(--font-heading);
  cursor: pointer;
  transition: border-color 150ms linear;
}

.view-toggle:hover { border-color: var(--blue-500); }

.view-toggle:focus-visible {
  outline: 2px solid var(--blue-500);
  outline-offset: 2px;
}

/* ============================================================
   MAPA
   ============================================================ */

.is-map .page {
  max-width: none;
  padding: 20px 16px 20px;
  overflow: hidden;
}

/* a tela onde o v4.js desenha o campo de quadradinhos e a fiação */
.is-map .fx {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

.is-map .intro,
.is-map .footer { z-index: 1; }

.is-map .brand { margin-bottom: 16px; }

.is-map .brand-logo { width: 150px; }

.is-map .legend {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 20px;
  margin-top: 16px;
}

.is-map .legend .tag {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.is-map .legend .tag::before {
  content: "";
  flex: none;
  width: 20px;
  height: 4px;
  background: linear-gradient(to right, var(--blue-500) 50%, transparent 50%) left top / 8px 4px repeat-x;
}

.is-map .hint {
  display: block;
  margin: 8px 0 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--muted);
}

.hint-mouse { display: none; }

@media (hover: hover) and (pointer: fine) {
  .hint-mouse { display: inline; }
  .hint-touch { display: none; }
}

.is-map .portfolio { margin-top: 8px; }

.is-map .stage {
  position: relative;
  height: clamp(700px, 215vw, 860px);
  touch-action: pan-y;
}

/* a árvore perde a caixa: sobram os itens, posicionados pelo v4.js */
.is-map .branch,
.is-map .tree,
.is-map .children {
  display: block;
  position: static;
  margin: 0;
  padding: 0;
}

.is-map .children::before { content: none; }

.is-map .stage .tag {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

/* --- itens: a pastilha do logo com o nome embaixo --- */

.is-map .node,
.is-map .node--root {
  --s: 80px;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  display: block;
  width: var(--s);
  height: var(--s);
  border-radius: 22%;
  opacity: 0;
  cursor: pointer;                 /* mão: é um link */
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  will-change: transform;
}

.is-map .children .node { --s: 68px; }
.is-map .children .children .node { --s: 60px; }

.is-map.is-ready .node,
.is-map.is-ready .node--root {
  opacity: 1;
  transition: opacity 200ms linear;
}

.is-map .node.is-grabbed,
.is-map .node--root.is-grabbed {
  z-index: 4;
  cursor: grabbing;
}

.is-map .node.is-on { z-index: 3; }

.is-map .card {
  display: block;
  width: 100%;
  height: 100%;
  padding: 7%;
  border-radius: 22%;
  box-shadow: var(--shadow-md);
  transition: border-color 150ms linear, box-shadow 200ms var(--ease), opacity 180ms linear;
}

.is-map .children .card { box-shadow: var(--shadow-md); }

.is-map .thumb {
  width: 100%;
  height: 100%;
  border-radius: 17%;
  pointer-events: none;
  -webkit-user-drag: none;
}

/* logo largo: a pastilha acompanha a proporção dele em vez de cortá-lo */
.is-map .node.node--wide {
  width: calc(var(--s) * 1.72);
  height: calc(var(--s) * 0.8);
  border-radius: 16px;
}

.is-map .node--wide .card {
  padding: 8px 10px;
  border-radius: 16px;
}

.is-map .node--wide .thumb { border-radius: 0; }

/* o nome fica escrito sob o logo; descrição e nota vão para a etiqueta
   (seguem no HTML para leitores de tela) */
.is-map .node .txt {
  position: absolute;
  top: 100%;
  left: 50%;
  width: max-content;
  max-width: calc(var(--s) + 44px);
  margin-top: 6px;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
}

.is-map .node .nm {
  padding: 0;
  font-size: 0.75rem;
  line-height: 1.2;
  text-shadow: 0 0 3px var(--surface-alt), 0 0 6px var(--surface-alt), 0 0 10px var(--surface-alt);
  transition: color 150ms linear;
}

.is-map .node .ds,
.is-map .node .nt {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

/* Item apoiado pela Proage: não é produto da empresa. Fica solto, sem ligação
   com a marca, menor e mais apagado que os logos da árvore; a indicação de
   apoio é só este texto acima do logo. Em foco ele volta à cor cheia. */
.is-map .chip {
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  display: block;
  width: max-content;
  transform: translateX(-50%);
  color: var(--green-700);
  font: 600 0.6875rem/1.2 var(--font-heading);
  white-space: nowrap;
  text-shadow: 0 0 3px var(--surface-alt), 0 0 6px var(--surface-alt), 0 0 10px var(--surface-alt);
  pointer-events: none;
}

.is-map .branch--apoio .node { --s: 52px; }

.is-map .branch--apoio .card { box-shadow: var(--shadow-sm); }

.is-map .branch--apoio .thumb {
  opacity: 0.9;
  filter: saturate(0.65);
  transition: opacity 180ms linear, filter 180ms linear;
}

.is-map .branch--apoio .node.is-on .thumb {
  opacity: 1;
  filter: none;
}

.is-map .branch--apoio .node .txt {
  max-width: 112px;                /* no celular o nome quebra em 3 linhas: ocupa menos largura no mapa */
  margin-top: 5px;
}

.is-map .branch--apoio .node .nm {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--muted);
}

/* selo no canto da pastilha: avisa que o logo abre um site */
.is-map .go {
  top: -7px;
  right: -7px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 5px;
  background: var(--blue-500);
  border: 2px solid var(--surface-alt);
  border-radius: 50%;
  color: #fff;
  box-shadow: 0 2px 6px rgb(11 43 68 / 0.22);
  transition: transform 220ms var(--ease), background-color 150ms linear;
}

.is-map .go svg { stroke-width: 2.2; }

.is-map .branch--apoio .go {
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  padding: 4px;
  background: #EAF5E7;
  color: var(--green-700);
  box-shadow: none;
}

.is-map .branch--apoio .node:hover .go,
.is-map .branch--apoio .node:focus-visible .go { color: var(--green-700); }

.is-map .node:hover .go,
.is-map .node:focus-visible .go { color: #fff; transform: none; }

.is-map .node.is-on .go {
  color: #fff;
  transform: scale(1.28);
  background: var(--blue-600);
}

.is-map .branch--apoio .node.is-on .go {
  background: var(--green-700);
  color: #fff;
}

.is-map .node:focus-visible { outline-offset: 4px; }

.is-map .node.is-on .card,
.is-map .node.is-path .card {
  border-color: var(--blue-500);
  box-shadow: var(--shadow-lg);
}

.is-map .node.is-on .nm { color: var(--blue-600); }

.is-map .branch--apoio .node.is-on .card { border-color: var(--green-500); }
.is-map .branch--apoio .node.is-on .nm { color: var(--green-700); }
.is-map .branch--apoio .node:focus-visible { outline-color: var(--green-700); }

/* com um item em foco, o que não é da linhagem dele recua */
.is-map .stage.has-on .node:not(.is-rel) .card { opacity: 0.4; }

/* o centro do grafo: a marca. Não é link — só pode ser arrastada. */
.is-map .node--root {
  --s: 156px;
  height: 64px;
  padding: 9px 16px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  cursor: grab;
}

.is-map .node--root img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
}

/* --- etiqueta: título, frases e o botão de abrir --- */

.is-map .label {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 5;
  display: block;
  width: max-content;
  max-width: min(310px, calc(100% - 16px));
  padding: 13px 15px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  color: inherit;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 160ms linear, visibility 0s linear 160ms;
}

.is-map .label.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 160ms linear;
}

/* tela estreita: a etiqueta vai de lado a lado, logo acima ou abaixo do item */
.is-map .label.is-docked {
  width: auto;
  max-width: none;
  left: 8px;
  right: 8px;
}

.is-map .label .nm {
  padding: 0;
  font-size: 1.0625rem;
}

.label-go {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 11px;
  padding: 8px 12px 8px 13px;
  background: var(--blue-500);
  border-radius: 8px;
  color: #fff;
  font: 600 0.8125rem/1.2 var(--font-heading);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms linear;
}

.label-go:hover { background: var(--blue-600); }

.label-go b { font-weight: 700; }

.label-go svg {
  flex: none;
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.label--apoio .label-go,
.label--apoio .label-go:hover { background: var(--green-700); }

/* a etiqueta aceita o mouse e o toque: dá para ir até o botão "Abrir".
   Só o botão é link; o resto do cartão não abre nada. */
.is-map .label.is-open.is-live { pointer-events: auto; }

/* --- cursor que passeia sozinho pelos logos --- */

.is-map .ghost {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 6;
  display: block;
  width: 26px;
  height: 26px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms linear;
  will-change: transform;
}

.is-map .ghost.is-on { opacity: 1; }

.ghost svg {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 3px rgb(11 43 68 / 0.35));
  transform-origin: 12% 8%;
  transition: transform 110ms var(--ease);
}

.ghost.is-press svg { transform: scale(0.8); }

/* no celular não há seta: o passeio aparece como um toque */
.ghost--touch svg { display: none; }

.ghost--touch::before {
  content: "";
  position: absolute;
  top: -15px;
  left: -15px;
  width: 30px;
  height: 30px;
  border: 2px solid rgb(1 113 186 / 0.75);
  border-radius: 50%;
  background: rgb(1 113 186 / 0.2);
  transition: transform 110ms var(--ease);
}

.ghost--touch.is-press::before { transform: scale(0.72); }

.is-map .footer { margin-top: 12px; }

/* --- telas largas: texto à esquerda, mapa ocupando o resto --- */

@media (min-width: 900px) {
  .is-map .page {
    display: grid;
    grid-template-columns: minmax(270px, 29%) minmax(0, 1fr);
    grid-template-rows: 1fr auto;
    column-gap: 20px;
    min-height: 100vh;
    min-height: 100svh;
    padding: 32px 36px 26px;
  }

  .is-map .intro {
    grid-column: 1;
    grid-row: 1;
    display: grid;
    grid-template-rows: auto 1fr;
    padding-bottom: 20px;
  }

  .is-map .brand { margin: 0; }

  .is-map .brand-logo { width: 190px; }

  .is-map .intro-body { align-self: center; }

  .is-map .bio-main { font-size: clamp(1.375rem, 0.7rem + 1.3vw, 2rem); }

  .is-map .legend {
    display: grid;
    gap: 4px;
    margin-top: 22px;
  }

  .is-map .hint { margin-top: 14px; }

  .is-map .portfolio {
    grid-column: 2;
    grid-row: 1 / -1;
    min-height: 0;
    margin: 0;
  }

  .is-map .stage {
    height: 100%;
    min-height: 640px;
    max-height: 920px;
  }

  .is-map .footer {
    grid-column: 1;
    grid-row: 2;
    margin: 0;
  }

  .is-map .node { --s: 112px; }
  .is-map .children .node { --s: 92px; }
  .is-map .children .children .node { --s: 78px; }

  .is-map .node .nm { font-size: 0.8125rem; }

  .is-map .branch--apoio .node { --s: 64px; }
  .is-map .branch--apoio .node .txt { max-width: 176px; }
  .is-map .branch--apoio .node .nm { font-size: 0.75rem; }

  .is-map .branch--apoio .go {
    top: -7px;
    right: -7px;
    width: 20px;
    height: 20px;
  }

  .is-map .go {
    top: -8px;
    right: -8px;
    width: 26px;
    height: 26px;
    padding: 6px;
  }

  .is-map .node--root {
    --s: 224px;
    height: 92px;
    padding: 13px 22px;
    border-radius: 20px;
  }
}

/* --- telas bem largas: logos ainda maiores --- */

@media (min-width: 1500px) and (min-height: 860px) {
  .is-map .node { --s: 128px; }
  .is-map .children .node { --s: 104px; }
  .is-map .children .children .node { --s: 88px; }

  .is-map .node .nm { font-size: 0.875rem; }

  .is-map .branch--apoio .node { --s: 72px; }

  .is-map .node--root {
    --s: 256px;
    height: 104px;
  }
}
