/* Seção veia (vv-) · O que acontece na veia · Dr. Diego Lima */
.vv {
  --vv-sobe: #c8382f;
  --vv-sobe-claro: #e0705f;
  --vv-volta: #2f5fae;
  --vv-volta-claro: #7ea2e0;
  --vv-pele: #d79a8f;
  --vv-mono: "Red Hat Mono", ui-monospace, monospace;
  --vv-dur: 11s;
  --vv-x: .5;            /* posição da veia no palco (lida pelo script) */
  position: relative;
  min-height: max(100svh, 860px);
  display: grid;
  align-items: center;
  background: var(--noite);
  overflow: clip;
}

/* ---------- fundo: noite do jardim + marinho ---------- */
.vv-fundo { position: absolute; inset: 0; z-index: -1; overflow: clip; pointer-events: none; }
.vv-fundo i { position: absolute; display: block; border-radius: 50%; will-change: transform; }
.vv-m1 { /* marinho do terno, atrás da veia */
  width: 80vmax; height: 80vmax; right: -22vmax; top: 50%; margin-top: -40vmax;
  background: radial-gradient(closest-side in oklch, rgb(35 36 67 / .95), rgb(35 36 67 / .45) 55%, rgb(35 36 67 / 0));
  animation: vv-deriva1 36s var(--ease-suave) infinite alternate;
}
.vv-m2 { /* orquídea, alto */
  width: 60vmax; height: 60vmax; left: 18vw; top: -34vmax;
  background: radial-gradient(closest-side in oklch, rgb(154 111 176 / .24), rgb(154 111 176 / .07) 60%, rgb(154 111 176 / 0));
  animation: vv-deriva2 29s var(--ease-suave) infinite alternate;
}
.vv-m3 { /* terra, embaixo à esquerda */
  width: 70vmax; height: 70vmax; left: -32vmax; bottom: -44vmax;
  background: radial-gradient(closest-side in oklab, rgb(78 58 48 / .8), rgb(78 58 48 / 0));
  animation: vv-deriva3 40s var(--ease-suave) infinite alternate;
}
@keyframes vv-deriva1 { to { transform: translate3d(-6vmax, 5vmax, 0) scale(1.06); } }
@keyframes vv-deriva2 { to { transform: translate3d(7vmax, 5vmax, 0) scale(.92); } }
@keyframes vv-deriva3 { to { transform: translate3d(8vmax, -4vmax, 0); } }

/* luzes de orquídea desfocadas (as do jardim do hero) */
.vv-luz { position: absolute; display: block; border-radius: 50%; aspect-ratio: 1; mix-blend-mode: screen; animation: vv-flutua 26s var(--ease-suave) infinite alternate; }
.vv-l1 { width: clamp(90px, 9vw, 150px); left: 93%; top: 9%; background: radial-gradient(closest-side, rgb(207 179 220 / .42), rgb(154 111 176 / .14) 55%, rgb(154 111 176 / 0)); }
.vv-l2 { width: clamp(50px, 5vw, 80px); left: 48%; top: 16%; background: radial-gradient(closest-side, rgb(207 179 220 / .34), rgb(154 111 176 / 0)); animation-duration: 31s; animation-delay: -9s; }
.vv-l3 { width: clamp(110px, 12vw, 200px); left: 82%; top: 72%; background: radial-gradient(closest-side, rgb(226 185 143 / .2), rgb(226 185 143 / 0)); animation-duration: 35s; animation-delay: -5s; }
.vv-l4 { width: clamp(60px, 6vw, 100px); left: 6%; top: 86%; background: radial-gradient(closest-side, rgb(207 179 220 / .28), rgb(154 111 176 / 0)); animation-duration: 28s; animation-delay: -14s; }
@keyframes vv-flutua {
  0% { transform: translate3d(0, 0, 0) scale(1); opacity: .7; }
  50% { opacity: 1; }
  100% { transform: translate3d(-22%, 26%, 0) scale(1.16); opacity: .5; }
}

/* ---------- palco 3D ---------- */
.vv-palco {
  position: absolute; z-index: 0; top: 0; bottom: 0; right: 0;
  width: 62%;
  pointer-events: none;
}
.vv-cena, .vv-poster {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 86%, transparent);
}
.vv-poster { object-fit: cover; object-position: 50% 50%; opacity: .9; transition: opacity 1.4s ease; }
.vv-cena { opacity: 0; transition: opacity 1.6s ease .1s; }
.vv-cena.pronta { opacity: 1; }
.vv.vv-3d .vv-poster { opacity: 0; }
.vv-fios { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; z-index: 2; }
.vv-fios line { stroke: rgb(237 228 223 / .55); stroke-width: 1; }
.vv-fios circle { fill: none; stroke: var(--creme); stroke-width: 1; }
.vv-fios circle.alvo { fill: var(--creme); stroke: none; }
.vv-fios .volta line { stroke: rgb(126 162 224 / .7); }
.vv-fios .volta circle { stroke: var(--vv-volta-claro); }
.vv-fios .volta circle.alvo { fill: var(--vv-volta-claro); }
.vv-fios .pele line { stroke: rgb(215 154 143 / .7); }
.vv-fios .pele circle { stroke: var(--vv-pele); }
.vv-fios .pele circle.alvo { fill: var(--vv-pele); }
.vv-fios g { opacity: 0; transition: opacity .7s ease; }
.vv-fios g.on { opacity: 1; transition-delay: .5s; }

.vv-rotulo {
  position: absolute; left: 0; top: 0; z-index: 3;
  font-family: var(--vv-mono); font-size: .875rem; line-height: 1.3;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--creme); white-space: nowrap;
  opacity: 0; visibility: hidden; transition: opacity .6s ease, visibility 0s .6s;
}
.vv-rotulo.on { opacity: 1; visibility: visible; transition: opacity .8s ease .55s, visibility 0s; }
.vv-rotulo b { display: block; font-weight: 500; }
.vv-rotulo span { display: block; margin-top: .2rem; font-size: .875rem; letter-spacing: .04em; text-transform: none; color: var(--texto-2); }
.vv-rotulo--sobe b { color: var(--vv-sobe-claro); }
.vv-rotulo--volta b { color: var(--vv-volta-claro); }
.vv-rotulo--pele b { color: var(--vv-pele); }
.vv-rotulo.esq { text-align: right; }

.vv-legenda {
  position: absolute; z-index: 3; left: calc(var(--vv-x) * 100%); bottom: clamp(1.4rem, 4vh, 2.6rem); transform: translateX(-50%);
  display: flex; gap: 1.4rem; white-space: nowrap;
  font-family: var(--vv-mono); font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--texto-3);
}
.vv-legenda span { display: inline-flex; align-items: center; gap: .5rem; }
.vv-legenda i { width: 18px; height: 3px; border-radius: 3px; }
.vv-c-sobe { background: linear-gradient(90deg, rgb(224 112 95 / 0), var(--vv-sobe-claro)); }
.vv-c-volta { background: linear-gradient(90deg, var(--vv-volta-claro), rgb(126 162 224 / 0)); }

/* ---------- texto ---------- */
.vv-texto { position: relative; z-index: 4; width: min(36rem, 40vw); }
.vv .sec-titulo { font-size: clamp(2.5rem, 1.5rem + 3vw, 4.2rem); }
.vv-intro { margin-top: 1.4rem; max-width: 30rem; }

.vv-passos { list-style: none; margin: 2.2rem 0 0; padding: 0; border-top: 1px solid var(--linha); }
.vv-passo { border-bottom: 1px solid var(--linha); }
.vv-passo-botao {
  position: relative; width: 100%; min-height: 64px;
  display: grid; grid-template-columns: 3.1rem 1fr; align-items: baseline;
  padding: 1.05rem 0 1.15rem; border: 0; background: none; color: inherit; text-align: left; cursor: pointer;
  font: inherit;
}
.vv-num { font-family: var(--vv-mono); font-size: .875rem; letter-spacing: .1em; color: var(--texto-3); transition: color .4s; }
.vv-passo-nome {
  font-family: var(--serifa); font-size: var(--t-h3); font-weight: 300; line-height: 1.15; color: var(--texto-2);
  transition: color .4s;
}
.vv-passo-botao:hover .vv-passo-nome { color: var(--texto); }
.vv-passo.ativo .vv-num { color: var(--madeira-clara); }
.vv-passo.ativo .vv-passo-nome { color: var(--creme); font-style: italic; font-weight: 400; }
/* trilha de progresso (a do letreiro do hero) */
.vv-barra { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; }
.vv-barra::after {
  content: ""; position: absolute; inset: 0; border-radius: 2px; background: var(--madeira-clara);
  transform: scaleX(0); transform-origin: left;
}
.vv-passo.ativo .vv-barra::after { transform: scaleX(1); opacity: .8; }
.js .vv.vv-auto .vv-passo.ativo .vv-barra::after { animation: vv-enche var(--vv-dur) linear both; }
.js .vv.vv-pausado .vv-passo.ativo .vv-barra::after,
.js .vv.vv-fora .vv-passo.ativo .vv-barra::after { animation-play-state: paused; }
@keyframes vv-enche { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.vv-passo-corpo { display: grid; grid-template-rows: 1fr; }
.vv-passo-corpo > div { overflow: hidden; min-height: 0; }
.vv-passo-corpo .sec-texto { padding: 0 0 1.4rem 3.1rem; max-width: 33rem; }
.js .vv-passo-corpo { grid-template-rows: 0fr; transition: grid-template-rows .7s var(--ease); }
.js .vv-passo.ativo .vv-passo-corpo { grid-template-rows: 1fr; }
.js .vv-passo-corpo > div { opacity: 0; transition: opacity .5s ease; }
.js .vv-passo.ativo .vv-passo-corpo > div { opacity: 1; transition: opacity .8s ease .25s; }
.vv-frase {
  padding: 0 0 .7rem 3.1rem;
  font-family: var(--serifa); font-style: italic; font-size: clamp(1.3rem, 1.15rem + .5vw, 1.6rem); line-height: 1.25; color: var(--madeira-clara);
}

.vv-fecho { margin-top: 2.4rem; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.4rem 2rem; }
.vv-citacao { margin: 0; padding-left: 1.1rem; border-left: 1px solid rgb(226 185 143 / .45); max-width: 27rem; }
.vv-citacao blockquote { margin: 0; font-family: var(--serifa); font-style: italic; font-size: 1.2rem; line-height: 1.35; color: var(--texto); }
.vv-citacao figcaption { margin-top: .4rem; font-size: .875rem; color: var(--texto-3); }

.vv-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* sem WebGL: o pôster fica, sem rótulos */
.vv.vv-sem-3d .vv-cena, .vv.vv-sem-3d .vv-fios, .vv.vv-sem-3d .vv-rotulo { display: none; }

/* pausa tudo fora da tela */
.vv.vv-fora .vv-fundo i, .vv.vv-fora .vv-luz { animation-play-state: paused; }

/* ---------- notebooks ---------- */
@media (max-width: 1240px) and (min-width: 981px) {
  .vv-texto { width: min(32rem, 44vw); }
  .vv-palco { width: 60%; }
}

/* ---------- celular e tablet ---------- */
@media (max-width: 980px) {
  .vv { --vv-x: .36; display: flex; flex-direction: column; align-items: stretch; min-height: 0; padding-bottom: calc(var(--sec-y) * .8); }
  .vv-texto { display: contents; }
  .vv-texto > .sec-rotulo, .vv-texto > .sec-titulo, .vv-intro { position: relative; z-index: 4; }
  .vv-texto > .sec-rotulo { order: 1; }
  .vv-texto > .sec-titulo { order: 2; }
  .vv-intro { order: 3; }
  .vv-palco {
    order: 4;
    position: relative; inset: auto; width: auto;
    height: clamp(480px, 68svh, 620px);
    margin: .6rem calc(var(--margem) * -1) 0;
  }
  .vv-passos { order: 5; position: relative; z-index: 4; margin-top: .4rem; }
  .vv-fecho { order: 6; }
  .vv-passo-botao { grid-template-columns: 2.6rem 1fr; min-height: 56px; padding: .9rem 0 1rem; }
  .vv-passo-corpo .sec-texto, .vv-frase { padding-left: 2.6rem; }
  .vv-fecho { position: relative; z-index: 4; flex-direction: column; align-items: flex-start; }
  .vv-legenda { left: var(--margem); right: var(--margem); transform: none; bottom: .4rem; flex-wrap: wrap; gap: .3rem 1rem; font-size: .75rem; letter-spacing: .1em; white-space: normal; }
  .vv-legenda .vv-fig { flex-basis: 100%; }
  .vv-rotulo { font-size: .875rem; letter-spacing: .08em; }
  .vv-rotulo span { white-space: normal; width: 9.5em; }
  .vv-rotulo.esq span { margin-left: auto; }
  .vv-m1 { right: -50vmax; }
}
@media (max-width: 400px) {
  .vv-passo-corpo .sec-texto, .vv-frase { padding-left: 0; }
  .vv-passo-botao { grid-template-columns: 2.3rem 1fr; }
}

/* ---------- movimento reduzido ---------- */
@media (prefers-reduced-motion: reduce) {
  .vv-cena { transition: none; }
  .js .vv-passo-corpo, .js .vv-passo-corpo > div { transition: none; }
}
.vv-fios .sobe line { stroke: rgb(224 112 95 / .7); }
.vv-fios .sobe circle { stroke: var(--vv-sobe-claro); }
.vv-fios .sobe circle.alvo { fill: var(--vv-sobe-claro); }
@media (max-width: 980px) {
  .vv-rotulo { padding: .32rem .55rem .38rem; border-radius: 8px; background: rgb(24 21 27 / .72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
}
