/* =============================================================================
   Movimento da Voicer Multimarcas
   Uma ideia só: a faixa laranja do V. Ela risca a tela ao trocar de página, cresce
   embaixo dos títulos e acompanha a rolagem. O resto é discreto: entradas curtas,
   um leve levantar nos cartões e a troca de tema abrindo a partir do botão.
   Tudo respeita "reduzir movimento" do aparelho.
   ============================================================================= */

@media (prefers-reduced-motion: no-preference) {

/* ---------- troca de página ---------- */
@view-transition { navigation: auto; }
.site-header { view-transition-name: site-header; }
::view-transition-group(site-header) { animation-duration: .45s; animation-timing-function: var(--ease-out); }
::view-transition-old(root) { animation: pageOut .28s var(--ease) both; }
::view-transition-new(root) { animation: pageIn .6s var(--ease-out) both; }
/* o carro do cartão vira a foto principal da página do veículo */
::view-transition-group(vimg) { animation-duration: .6s; animation-timing-function: var(--ease-out); }
::view-transition-old(vimg), ::view-transition-new(vimg) { height: 100%; object-fit: cover; }
.stage-photo:not([hidden]) img[data-stage-img] { view-transition-name: vimg; }
@keyframes pageOut { to { opacity: 0; transform: translateY(-10px) scale(.995); } }
@keyframes pageIn {
  from { opacity: 0; clip-path: polygon(0 0, 0 0, -24% 100%, -24% 100%); transform: translateY(14px); }
  to { opacity: 1; clip-path: polygon(0 0, 124% 0, 100% 100%, -24% 100%); transform: none; }
}
/* faixa laranja que atravessa a tela enquanto a nova página abre */
.route-stripe { position: fixed; z-index: 120; top: 0; bottom: 0; left: -30vw; width: 14vw; background: var(--orange); transform: skewX(-14deg); pointer-events: none; opacity: 0; }
.route-stripe.is-go { animation: stripe .7s var(--ease-out) both; }
@keyframes stripe { 0% { transform: translateX(0) skewX(-14deg); opacity: 1; } 100% { transform: translateX(160vw) skewX(-14deg); opacity: 1; } }

/* ---------- troca de tema: abre em círculo a partir do botão ---------- */
html.vt-theme::view-transition-old(root) { animation: none; }
html.vt-theme::view-transition-new(root) { animation: themeOpen .7s var(--ease-out) both; clip-path: circle(0 at var(--vt-x, 50%) var(--vt-y, 0)); }
@keyframes themeOpen { to { clip-path: circle(150vmax at var(--vt-x, 50%) var(--vt-y, 0)); } }

/* ---------- progresso de rolagem ---------- */
.scroll-line { position: fixed; z-index: 95; top: 0; left: 0; right: 0; height: 3px; background: var(--orange); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); pointer-events: none; }
.scroll-line::after { content: ""; position: absolute; right: -8px; top: 0; height: 100%; width: 16px; background: inherit; transform: skewX(-24deg); }

/* ---------- entrada dos blocos ao rolar ---------- */
.js-motion .rv { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease-out), transform .8s var(--ease-out); transition-delay: calc(var(--rv-i, 0) * 70ms); }
.js-motion .rv.is-in { opacity: 1; transform: none; }
/* faixa laranja sob os títulos de seção: cresce quando o título aparece */
.js-motion .section-head .t-h2 { position: relative; }
.js-motion .section-head .t-h2::after { content: ""; display: block; width: 56px; height: 4px; margin-top: 14px; background: var(--orange); transform-origin: 0 50%; transform: scaleX(0) skewX(-24deg); transition: transform .8s var(--ease-out) .25s; }
.js-motion .section-head.is-in .t-h2::after, .js-motion .section-head .rv.is-in .t-h2::after { transform: scaleX(1) skewX(-24deg); }

/* ---------- abertura da home: uma sequência só ---------- */
.hero-empty .hero-brand, .hero-empty .hero-title, .hero-empty .hero-title span, .hero-empty .hero-actions { animation: copyIn .9s var(--ease-out) both; }
.hero-empty .hero-brand { animation-delay: .15s; }
.hero-empty .hero-title { animation-delay: .3s; }
.hero-empty .hero-title span { animation-delay: .55s; }
.hero-empty .hero-actions { animation-delay: .75s; }
.hero-brand .dot { animation: dashGrow .8s var(--ease-out) .1s both; transform-origin: 0 50%; }
@keyframes dashGrow { from { transform: scaleX(0) skewX(-24deg); } to { transform: scaleX(1) skewX(-24deg); } }


/* ---------- celular: movimentos mais curtos e leves (a maioria dos visitantes está aqui) ---------- */
@media (max-width: 980px), (pointer: coarse) {
  ::view-transition-old(root) { animation: pageOutM .18s linear both; }
  ::view-transition-new(root) { animation: pageInM .4s var(--ease-out) both; }
  .js-motion .rv { transform: translateY(14px); transition-duration: .5s, .55s; transition-delay: calc(var(--rv-i, 0) * 45ms); }
  .scroll-line { height: 2px; }
  .route-stripe { width: 22vw; left: -40vw; animation-duration: .55s; }
  .route-stripe.is-go { animation-duration: .55s; }
  .js-motion .section-head .t-h2::after { width: 44px; height: 3px; margin-top: 10px; }
}
@keyframes pageOutM { to { opacity: 0; } }
@keyframes pageInM { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

}

/* ---------- toques com mouse ---------- */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .btn { position: relative; overflow: hidden; isolation: isolate; }
  .btn-primary::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(105deg, transparent 32%, rgba(255,255,255,.4) 50%, transparent 68%); transform: translateX(-130%); }
  .btn-primary:hover::after { transform: translateX(130%); transition: transform .8s var(--ease-out); }
  .btn:active { transform: translateY(1px) scale(.99); }
  .vcard { transition: transform .45s var(--ease-out), box-shadow .45s var(--ease-out); }
  .vcard:hover { transform: translateY(-5px); box-shadow: 0 22px 40px -22px rgba(6,28,54,.45); }
  .vcard::before { content: ""; position: absolute; z-index: 2; left: 0; top: 0; width: 0; height: 3px; background: var(--orange); transition: width .5s var(--ease-out); pointer-events: none; }
  .vcard:hover::before { width: 100%; }
  .path:hover img { transform: scale(1.06); }
  .brand-tile { transition: transform .35s var(--ease-out), background-color .2s var(--ease); }
  .brand-tile:hover { transform: translateY(-3px); }
}

/* ---------- troca de cor ---------- */
.site-header, .site-footer, .section, .btn, .nav a { transition-property: background-color, color, border-color, box-shadow, transform; }
html.theme-anim, html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after { transition: background-color .45s var(--ease), color .45s var(--ease), border-color .45s var(--ease), fill .45s var(--ease) !important; }
