/* Zavra · Visão (página inicial). Depende de site.css. */

/* abertura: o Z como janela para a cor */
.hero { margin-top: calc(-1 * var(--navh)); padding-top: var(--navh); min-height: clamp(600px, 86svh, 860px); display: grid; align-items: center }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.34fr) minmax(0, .66fr); gap: clamp(32px, 5vw, 80px); align-items: center; padding-block: 48px }
.hero h1 { font-size: clamp(2.5rem, 4.9vw, 4.375rem); font-weight: 460; line-height: 1.04; letter-spacing: -.04em; text-wrap: balance }
/* três linhas a partir de telas médias: cada trecho inteiro na sua linha; no celular, quebra natural */
@media (min-width: 901px) { .hero h1 .h1-l { display: block; white-space: nowrap } }
@media (max-width: 900px) { .hero h1 { max-width: 13ch } }
/* a segunda frase usa o degradê do Z ao lado (céu → verde → areia) e desliza devagar, como o campo do símbolo */
/* "Feita sob medida." sempre numa linha própria e inteira */
.hero h1 .h1-2 { display: block; white-space: nowrap; background: linear-gradient(90deg, #8ea6d2, #8fc1c9 30%, #b7d0b4 55%, #d7c495 80%, #8ea6d2) 0 0 / 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: h1-glow 14s ease-in-out infinite alternate }
@keyframes h1-glow { to { background-position: 100% 0 } }
.hero .sub { margin-top: 28px; font-size: var(--fs-lead); line-height: 1.55; color: var(--muted); max-width: 56ch }
.hero .ctas { margin-top: 36px }
/* invólucro do Z: ocupa a coluna e o alinha à direita; a animação de abertura fica nele */
.zwin-open { display: flex; justify-content: flex-end; min-width: 0 }
.zwin { width: 100%; max-width: 460px; aspect-ratio: 1 / 1; justify-self: end; display: block;
  clip-path: polygon(0 0, 100% 0, 100% 28.572%, 71.429% 28.572%, 71.429% 57.143%, 42.857% 57.143%, 42.857% 85.715%, 100% 85.715%, 100% 100%, 0 100%, 0 71.429%, 28.572% 71.429%, 28.572% 42.857%, 57.143% 42.857%, 57.143% 14.286%, 0 14.286%) }

/* manifesto: é o título da escada, sobre uma nuvem de cor desenhada só com degradês que terminam transparentes bem
   antes da borda e desfocada por cima. Duas camadas se movem em sentidos opostos com o mouse (visao.js):
   o calor vem até o cursor, o azul se afasta. */
.cloud { position: absolute; left: 38%; top: 46%; z-index: -1; width: min(900px, 120vw); height: clamp(300px, 30vw, 400px); pointer-events: none; filter: blur(36px);
  transform: translate(calc(-50% + var(--x, 0px)), calc(-50% + var(--y, 0px))) scale(var(--s, 1)); will-change: transform }
.cloud.warm { background:
    radial-gradient(34% 52% at 30% 48%, rgba(118, 108, 74, .85), rgba(118, 108, 74, 0) 72%),
    radial-gradient(28% 46% at 47% 40%, rgba(52, 104, 100, .8), rgba(52, 104, 100, 0) 72%),
    radial-gradient(22% 38% at 78% 42%, rgba(128, 116, 80, .6), rgba(128, 116, 80, 0) 72%) }
.cloud.cool { background: radial-gradient(32% 50% at 64% 54%, rgba(64, 92, 148, .9), rgba(62, 88, 140, 0) 72%) }
.lit { background: #4d4d4d url("../img/mata.jpg") 40% 45% / 160% auto; background-blend-mode: screen; -webkit-background-clip: text; background-clip: text; color: transparent }
/* screen a 30%: o campo clareia o bastante para ficar acima de 3:1 sobre a tinta, sem perder o calor; no papel, multiply escurece */
.light .lit { background-color: #6b5a2c; background-blend-mode: multiply }
/* sobre a nuvem, o destaque é uma areia clara e sólida: contraste alto em qualquer ponto da nuvem */
.st-head .lit { background: none; color: #e4cf9c; -webkit-text-fill-color: currentColor }
/* no papel: título em degradê mais escuro */
.hero.light h1 .h1-2 { background-image: linear-gradient(90deg, #3f68a3, #2f7f87 30%, #4b7f5a 55%, #8a7335 80%, #3f68a3) }
.muda { position: relative; isolation: isolate; padding-block: var(--sec-y) }
.stair { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px }
/* o título começa na mesma linha do topo do degrau de cima */
.st-head { position: relative; grid-column: 1 / 4; grid-row: 1; align-self: start; padding: 0 24px 0 0 }
.st-head h2 { margin-top: -.14em; max-width: 25ch; font-size: var(--fs-statement); font-weight: 440; line-height: 1.12; letter-spacing: -.03em; text-wrap: balance }
.st-head .more { display: inline-flex; gap: 6px; margin-top: 20px; font-size: var(--fs-sm); color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line-2); padding-bottom: 2px }
.st-head .more:hover { color: var(--text); border-color: var(--text) }
.step { position: relative; isolation: isolate; overflow: hidden; border-radius: 4px; min-height: clamp(150px, 15vw, 196px); padding: clamp(18px, 2vw, 26px); display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; background-color: #333; background-size: cover; background-position: center }
.step::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(8, 10, 14, .72), rgba(8, 10, 14, .4) 55%, rgba(8, 10, 14, .22)) }
.step::after { content: ""; position: absolute; inset: 0; z-index: -1; background: url("../img/grain.png") 0 0 / 160px 160px; mix-blend-mode: overlay; opacity: .16 }
.step h3 { color: #fff; font-size: clamp(1.125rem, 1.7vw, 1.5rem); font-weight: 550; letter-spacing: -.02em; line-height: 1.15 }
.step p { font-size: var(--fs-sm); line-height: 1.45; color: #fff; max-width: 36ch }
.s1 { grid-column: 4 / 5; grid-row: 1 }
.s2 { grid-column: 3 / 5; grid-row: 2 }
.s3 { grid-column: 2 / 5; grid-row: 3 }
.s4 { grid-column: 1 / 5; grid-row: 4 }
.f-ceu { background-image: url("../img/ceu.jpg"); background-position: 30% 35% }
.f-jade { background-image: url("../img/jade.jpg"); background-position: 40% 40% }
.f-mar { background-image: url("../img/mar.jpg"); background-position: 50% 70% }
.f-mata { background-image: url("../img/mata.jpg"); background-position: 50% 45% }

/* feito para a sua empresa */
.seu { padding-block: var(--sec-y) }
.seu-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 96px) }
.seu-head { display: grid; gap: 14px; align-content: start }
.seu-head h2 { font-size: var(--fs-h2); font-weight: 460; line-height: 1.04; letter-spacing: -.035em; margin-top: -.08em }
.evo { margin: clamp(32px, 4vw, 48px) 0 0; max-width: 480px }
/* rótulos direto nas linhas, no lugar de uma legenda: cada rótulo fica ao lado do que descreve */
.evo-plot { position: relative }
.evo svg { display: block; width: 100%; height: auto; overflow: visible }
.evo-grid { stroke: var(--line); stroke-width: 1 }
.evo-gap { opacity: .45 }
.evo-need { fill: none; stroke: var(--faint); stroke-width: 1.5; stroke-dasharray: 4 5 }
.evo-old { fill: none; stroke: #8a8d93; stroke-width: 2 }
.evo-dot { fill: #8a8d93 }
.evo-zavra { fill: none; stroke-width: 3; stroke-linejoin: miter; stroke-dasharray: 1; stroke-dashoffset: 0 }
/* gráfico em sequência (visao.js): sistema comprado, depois a escada da Zavra, depois a defasagem e os rótulos */
.evo.will-draw .evo-old { stroke-dasharray: 1; stroke-dashoffset: 1 }
.evo.will-draw .evo-zavra { stroke-dashoffset: 1 }
.evo.will-draw .evo-gap, .evo.will-draw .lb-zavra, .evo.will-draw .lb-gap, .evo.will-draw .lb-old, .evo.will-draw .evo-dot { opacity: 0 }
.evo.play .evo-old { stroke-dashoffset: 0; transition: stroke-dashoffset 1s cubic-bezier(.45, 0, .2, 1) .1s }
.evo.play .evo-dot { opacity: 1; transition: opacity .3s ease .1s }
.evo.play .lb-old { opacity: 1; transition: opacity .5s ease .7s }
.evo.play .evo-zavra { stroke-dashoffset: 0; transition: stroke-dashoffset 2.2s cubic-bezier(.45, 0, .2, 1) .9s }
.evo.play .evo-gap { opacity: .45; transition: opacity .9s ease 2.6s }
.evo.play .lb-zavra { opacity: 1; transition: opacity .5s ease 2.9s }
.evo.play .lb-gap { opacity: 1; transition: opacity .5s ease 3.2s }
.lb { position: absolute; right: 4.2%; font-size: var(--fs-xs); line-height: 1.2; white-space: nowrap; color: var(--muted) }
.lb-need { top: calc(19.5% - 28px) }
.lb-zavra { top: 39%; right: 4.2%; font-weight: 650; color: #2f7a62 }
.lb-zavra .wm-sig { height: .86em; width: calc(.86em * 3140 / 700); filter: drop-shadow(0 0 2px var(--bg, var(--paper))) drop-shadow(0 0 4px var(--bg, var(--paper))) drop-shadow(0 0 6px var(--bg, var(--paper))) }
.lb-old { top: calc(78.8% + 6px) }
.lb-gap { right: auto; left: 64%; top: 63%; color: #6b5a2c; font-weight: 600 }
.lb-zavra, .lb-gap { text-shadow: 0 0 2px var(--bg, var(--paper)), 0 0 4px var(--bg, var(--paper)), 0 0 8px var(--bg, var(--paper)), 0 0 12px var(--bg, var(--paper)) }
.evo-axis { display: flex; justify-content: space-between; padding: 10px 4.2% 0; font-size: var(--fs-2xs); letter-spacing: .08em; text-transform: uppercase; color: var(--faint) }
.seu-body .lead { font-size: var(--fs-lead); line-height: 1.55; color: var(--muted); max-width: 52ch }
.facts { list-style: none; padding: 0; margin-top: 36px; display: grid; gap: 0 }
.facts li { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: 8px 24px; padding-block: 18px; border-top: 1px solid var(--line) }
.facts b { font-weight: 600 }
.facts span { color: var(--muted); font-size: var(--fs-sm) }
.seu .ctas { margin-top: 36px }

/* tablet e celular */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr }
  .zwin { max-width: 300px; justify-self: start; order: -1 }
  .zwin-open { order: -1; justify-content: flex-start }
  .evo { max-width: 520px }
  .seu-grid { grid-template-columns: 1fr }
}
@media (max-width: 760px) {
  .hero { min-height: 0 }
  .hero-grid { padding-block: 28px 64px; gap: 28px }
  /* no celular, o Z fica pequeno, em cima, como a marca da abertura; título, subtítulo e botões cabem na primeira tela */
  .zwin { max-width: 96px }
  .hero .sub .s { display: none }
  .hero .sub { margin-top: 18px }
  .hero .ctas { margin-top: 26px }
  .stair { grid-template-columns: minmax(0, 1fr); gap: 6px }
  .st-head { grid-column: 1; grid-row: 1; padding: 0 0 24px }
  .s1, .s2, .s3, .s4 { grid-column: 1; grid-row: auto; min-height: 150px }
  .s1 { margin-left: 21% } .s2 { margin-left: 14% } .s3 { margin-left: 7% }
  .facts li { grid-template-columns: 1fr; gap: 4px }
}
/* telas muito estreitas: o título encolhe um pouco para "Feita sob medida." caber inteiro numa linha */
@media (max-width: 374px) { .hero h1 { font-size: 2.375rem } }

/* ---------- movimento da Visão ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* abertura: uma vez, em menos de 1,5s; o título sobe linha a linha e o Z se abre de baixo para cima */
  @keyframes v-rise { from { opacity: 0; transform: translateY(26px) } }
  @keyframes v-open { from { clip-path: inset(100% 0 0 0); transform: translateY(24px) } }
  .hero h1 > span { animation: v-rise 1s cubic-bezier(.16, 1, .3, 1) both }
  .hero h1 > span:nth-child(2) { animation-delay: .09s }
  .hero h1 > span:nth-child(3) { animation-delay: .18s }
  /* a segunda frase também entra, junto com o brilho do degradê */
  .hero h1 > .h1-2 { animation: v-rise 1s cubic-bezier(.16, 1, .3, 1) both, h1-glow 14s ease-in-out infinite alternate }
  .hero .sub { animation: v-rise 1s cubic-bezier(.16, 1, .3, 1) .32s both }
  .hero .ctas { animation: v-rise 1s cubic-bezier(.16, 1, .3, 1) .42s both }
  .zwin-open { animation: v-open 1.4s cubic-bezier(.16, 1, .3, 1) .1s both }


  /* degraus: cada um se estende a partir da borda direita, de baixo para cima */
  .stair.will .step { clip-path: inset(0 0 0 100% round 4px) }
  .stair.will .step > * { opacity: 0; transform: translateX(14px) }
  .stair.go .step { clip-path: inset(0 0 0 0 round 4px); transition: clip-path .9s cubic-bezier(.65, 0, .2, 1) }
  .stair.go .step > * { opacity: 1; transform: none; transition: opacity .6s ease, transform .8s cubic-bezier(.16, 1, .3, 1) }
  .stair.go .s4 { transition-delay: 0s } .stair.go .s4 > * { transition-delay: .35s }
  .stair.go .s3 { transition-delay: .14s } .stair.go .s3 > * { transition-delay: .49s }
  .stair.go .s2 { transition-delay: .28s } .stair.go .s2 > * { transition-delay: .63s }
  .stair.go .s1 { transition-delay: .42s } .stair.go .s1 > * { transition-delay: .77s }
}

/* ---------- abertura: o Z se enche (intro.js liga a classe .intro só na primeira visita da sessão) ----------
   O símbolo aparece vazio, como um recipiente, e um líquido com as cores da marca o enche devagar, subindo na direção
   da escada, de baixo à esquerda para cima à direita (~1,5s). Tudo em CSS, para começar no primeiro quadro, junto com
   o resto: animação SMIL só começaria quando a página terminasse de carregar. Cheio, o Z cresce de leve
   e a tela se abre num esmaecer longo, que já mostra a página por trás; a abertura da página entra durante esse
   esmaecer, para a passagem não parecer apressada. Tudo em ~2,4s. */
.zintro { display: none }
@media (prefers-reduced-motion: no-preference) {
  .intro .zintro { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--paper); pointer-events: none;
    animation: zi-out .8s cubic-bezier(.4, 0, .2, 1) 1.6s forwards }
  .zi { width: 112px; height: 112px; overflow: visible; animation: zi-grow 1s cubic-bezier(.45, 0, .2, 1) 1.5s forwards }
  .zi-glass { fill: rgba(15, 16, 19, .07) }
  /* o líquido parte já encostado no canto de baixo e sobe na diagonal; as duas ondas correm na superfície (unidades do SVG) */
  .zi-rise { transform: translate(-6.3px, 6.3px); animation: zi-rise 1.5s cubic-bezier(.3, .3, .55, 1) forwards }
  .zi-w1 { animation: zi-w1 .8s linear infinite }
  .zi-w2 { transform: translate(-2px, .12px); animation: zi-w2 1.05s linear infinite }
  @keyframes zi-rise { to { transform: translate(1.35px, -1.35px) } }
  @keyframes zi-w1 { to { transform: translateX(-4px) } }
  @keyframes zi-w2 { from { transform: translate(-2px, .12px) } to { transform: translate(-6px, .12px) } }
  @keyframes zi-grow { to { transform: scale(1.18) } }
  @keyframes zi-out { to { opacity: 0; visibility: hidden } }
  /* com a abertura, o título espera ela terminar */
  .intro .hero h1 > span, .intro .hero .sub, .intro .hero .ctas, .intro .zwin-open { animation-delay: 1.95s }
  .intro .hero h1 > span:nth-child(2) { animation-delay: 2.05s }
  .intro .hero h1 > span:nth-child(3) { animation-delay: 2.15s }
  .intro .hero .sub { animation-delay: 2.31s }
  .intro .hero .ctas { animation-delay: 2.43s }
}
