/* ==========================================================================
   Limpô — camada de experiência
   Movimento, vídeo e microinterações. Carregada depois do CSS do build,
   portanto sobrescreve regras de mesma especificidade.
   ========================================================================== */

:root {
  --ease-expo: cubic-bezier(.16, 1, .3, 1);
  --ease-soft: cubic-bezier(.22, .61, .36, 1);
  --ease-back: cubic-bezier(.34, 1.4, .64, 1);
}

/* --------------------------------------------------------------------------
   1. Ícones (setas ↗ ↓ ↑ trocadas por SVG)
   -------------------------------------------------------------------------- */

.ui-icon { display: inline-block; width: 1.05em; height: 1.05em; flex: 0 0 auto; vertical-align: -.16em; margin-left: .35em }
.button .ui-icon, .footer-cta .ui-icon { width: 17px; height: 17px; margin-left: auto }
.text-link .ui-icon { width: 16px; height: 16px; margin-left: 24px }
.footer-column .ui-icon { width: 13px; height: 13px }
.footer-bottom .ui-icon { width: 14px; height: 14px }

/* --------------------------------------------------------------------------
   2. Vídeo — base
   -------------------------------------------------------------------------- */

video { background-color: #071d37 }
video::-webkit-media-controls { display: none !important }

/* Deriva lenta nos vídeos de fundo das seções internas (desktop) */
@media (min-width: 801px) and (prefers-reduced-motion: no-preference) {
  .scale-section .ambient-video,
  .contact .ambient-video {
    transform: scale(1.06);
    animation: ambientDrift 30s var(--ease-soft) infinite alternate;
  }
}
@keyframes ambientDrift {
  from { transform: scale(1.05) translate3d(0, 0, 0) }
  to   { transform: scale(1.13) translate3d(-1.2%, -1.6%, 0) }
}

/* --------------------------------------------------------------------------
   3. Vídeo — play manual (especialidades e portfólio)
   -------------------------------------------------------------------------- */

.v-trigger {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.portfolio-media .v-trigger { z-index: 3 }
.service-card .v-trigger { align-content: center; padding-bottom: 22% }

.v-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .55);
  background: rgba(4, 18, 35, .38);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 18px 46px rgba(0, 0, 0, .32);
  transition: transform .55s var(--ease-back), background .35s, border-color .35s, opacity .4s;
}
.v-btn::before {
  content: "";
  position: absolute;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 1px solid var(--cyan-light);
  opacity: 0;
  animation: none;
}
.v-icon { width: 22px; height: 22px; margin: 0; grid-area: 1/1; transition: opacity .3s, transform .3s }
.v-icon-play { margin-left: 3px }
.v-icon-pause { opacity: 0; transform: scale(.7) }

.v-hint {
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: 9px;
  color: rgba(255, 255, 255, .82);
  transition: opacity .4s, transform .5s var(--ease-expo);
}

.v-trigger:hover .v-btn { transform: scale(1.07); background: rgba(16, 191, 202, .72); border-color: transparent }
.v-trigger:hover .v-btn::before { opacity: 1; animation: playRing 1.6s var(--ease-soft) infinite }
.v-trigger:active .v-btn { transform: scale(.96) }
.v-trigger:focus-visible { outline: 2px solid var(--cyan-light); outline-offset: -6px }

@keyframes playRing {
  from { transform: scale(1); opacity: .55 }
  to   { transform: scale(1.42); opacity: 0 }
}

/* Carregando */
.is-loading .v-btn { animation: pulseBtn 1s ease-in-out infinite }
.is-loading .v-hint { opacity: .45 }
@keyframes pulseBtn { 0%, 100% { opacity: 1 } 50% { opacity: .45 } }

/* Tocando: o botão some e volta só no hover/tap */
.is-playing .v-btn { opacity: 0; transform: scale(.8) }
.is-playing .v-hint { opacity: 0; transform: translateY(8px) }
.is-playing .v-trigger:hover .v-btn { opacity: 1; transform: scale(1) }
.is-playing .v-icon-play { opacity: 0; transform: scale(.7) }
.is-playing .v-icon-pause { opacity: 1; transform: none }

/* Barra de progresso */
.v-progress {
  position: absolute;
  z-index: 4;
  inset: auto 0 0 0;
  height: 2px;
  background: rgba(255, 255, 255, .14);
  opacity: 0;
  transition: opacity .4s;
  pointer-events: none;
}
.is-playing .v-progress, .is-loading .v-progress { opacity: 1 }
.v-progress i {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--cyan-light));
  transform: scaleX(var(--v-p, 0));
  transform-origin: 0 50%;
}

/* Cartão de serviço: o poster ganha vida no hover, mas só até o play */
.service-card .ambient-video, .portfolio-media video { transition: transform 1.2s var(--ease-expo), filter .8s, opacity .6s }
.service-card.is-playing::after { opacity: .55 }
.service-card::after { transition: opacity .7s }
.service-card.is-playing .service-overlay p { opacity: .55 }
.service-overlay p { transition: opacity .5s }

/* Botão discreto quando o navegador bloqueia o autoplay do fundo */
.v-wake {
  position: absolute;
  z-index: 5;
  inset: auto 18px 18px auto;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 15px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 99px;
  background: rgba(4, 18, 35, .5);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: #fff;
  font-size: 9px;
  letter-spacing: .16em;
  text-transform: uppercase;
  cursor: pointer;
}
.v-wake .ui-icon { width: 13px; height: 13px; margin: 0 }

@media (max-width: 560px) {
  .v-btn, .v-btn::before { width: 62px; height: 62px }
  .service-card .v-trigger { padding-bottom: 30% }
}

/* --------------------------------------------------------------------------
   4. Sistema de reveal
   -------------------------------------------------------------------------- */

.motion-ready [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  filter: none;
  transition: opacity .9s var(--ease-soft), transform 1s var(--ease-expo);
}
.motion-ready [data-reveal].is-visible { opacity: 1; transform: none }

.motion-ready [data-reveal="stagger"] > * {
  opacity: 0;
  transform: translate3d(0, 26px, 0);
  transition: opacity .8s var(--ease-soft), transform .95s var(--ease-expo);
  transition-delay: calc(var(--r-i, 0) * 90ms);
}
.motion-ready [data-reveal="stagger"].is-visible > * { opacity: 1; transform: none }
.motion-ready [data-reveal="stagger"].is-visible > :nth-child(2),
.motion-ready [data-reveal="stagger"].is-visible > :nth-child(3) { transition-delay: calc(var(--r-i, 0) * 90ms) }

/* Títulos: as palavras sobem de dentro de uma máscara */
.sw {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding: .06em .05em .14em;
  margin: -.06em -.05em -.14em;
}
.swi {
  display: inline-block;
  opacity: 0;
  transform: translate3d(0, 108%, 0);
  transition: transform 1s var(--ease-expo), opacity .6s ease;
  transition-delay: calc(var(--w-i, 0) * 55ms);
}
.is-visible .swi, .swi.is-shown { opacity: 1; transform: none }

/* Linha que cresce sob o eyebrow numerado */
.motion-ready .eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  max-width: 90px;
  background: currentColor;
  opacity: .28;
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 1.1s var(--ease-expo) .25s;
}
.motion-ready .is-visible .eyebrow::after { transform: scaleX(1) }
.hero .eyebrow::after, .projects-title .eyebrow::after { display: none }

/* --------------------------------------------------------------------------
   5. Hero
   -------------------------------------------------------------------------- */

.hero-video {
  will-change: transform;
  transition: none;
  transform: scale(calc(1.03 + var(--hero-p, 0) * .09));
}
.hero-copy {
  opacity: calc(1 - var(--hero-p, 0) * .95);
  transform: translate3d(0, calc(var(--hero-p, 0) * 56px), 0);
}
.hero.is-parallax .hero-copy { filter: blur(calc(var(--hero-p, 0) * 9px)) }

.motion-ready .hero-video { animation: heroVideoIn 2.1s var(--ease-soft) }
@keyframes heroVideoIn {
  from { opacity: 0; transform: scale(1.18) }
  to   { opacity: 1; transform: scale(1.03) }
}

.motion-ready .hero-copy > * { opacity: 0; animation: heroRise 1.1s var(--ease-expo) forwards }
.motion-ready .hero .eyebrow { animation-delay: .45s }
.motion-ready .hero-lead { animation-delay: .95s }
.motion-ready .hero-actions { animation-delay: 1.1s }
.motion-ready .hero h1 { opacity: 0; animation: heroTitle 1.4s var(--ease-expo) .6s forwards }
.motion-ready .hero-index { opacity: 0; animation: heroRise 1.1s var(--ease-expo) 1.35s forwards }

@keyframes heroRise {
  from { opacity: 0; transform: translate3d(0, 24px, 0) }
  to   { opacity: 1; transform: none }
}
@keyframes heroTitle {
  from { opacity: 0; transform: translate3d(0, 34px, 0); clip-path: inset(0 0 102% 0) }
  to   { opacity: 1; transform: none; clip-path: inset(-30% -12% -14% -6%) }
}

/* Indicador de scroll com um traço que respira */
.hero-index span:last-child { display: flex; align-items: center; gap: 14px }
.hero-index span:last-child::after {
  content: "";
  width: 46px;
  height: 1px;
  background: linear-gradient(90deg, var(--cyan-light), transparent);
  animation: scrollCue 2.4s var(--ease-soft) infinite;
}
@keyframes scrollCue {
  0%   { transform: scaleX(.15); transform-origin: 0 50%; opacity: .35 }
  55%  { transform: scaleX(1); transform-origin: 0 50%; opacity: 1 }
  56%  { transform: scaleX(1); transform-origin: 100% 50% }
  100% { transform: scaleX(.15); transform-origin: 100% 50%; opacity: .35 }
}

/* --------------------------------------------------------------------------
   6. Barra de progresso e topbar
   -------------------------------------------------------------------------- */

.scroll-line {
  width: 100%;
  height: 2px;
  transform: scaleX(0);
  transform-origin: 0 50%;
  box-shadow: 0 0 18px rgba(16, 191, 202, .55);
  will-change: transform;
}

.topbar {
  position: fixed;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  transition: height .5s var(--ease-expo), background .45s, transform .55s var(--ease-expo), border-color .45s;
}
.topbar.is-scrolled {
  height: 78px;
  background: linear-gradient(180deg, rgba(4, 17, 33, .97), rgba(4, 17, 33, .9));
  border-bottom-color: rgba(255, 255, 255, .12);
}
.topbar.is-hidden { transform: translateY(-102%) }
.topbar .brand-logo { transition: height .5s var(--ease-expo) }
.topbar.is-scrolled .brand-logo { height: 40px }

.topbar nav a { position: relative; transition: opacity .3s }
.topbar nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -7px;
  width: 100%;
  height: 1px;
  background: var(--cyan-light);
  transform: scaleX(0);
  transform-origin: 100% 50%;
  transition: transform .5s var(--ease-expo);
}
.topbar nav a:hover::after, .topbar nav a.is-current::after { transform: scaleX(1); transform-origin: 0 50% }
.topbar nav a.is-current { opacity: 1 }

section[id], .hero { scroll-margin-top: 92px }

/* --------------------------------------------------------------------------
   7. Botões e links
   -------------------------------------------------------------------------- */

.button {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: transform .5s var(--ease-expo), box-shadow .5s var(--ease-expo), background .35s, color .35s;
}
.button::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, .5) 50%, transparent 68%);
  transform: translateX(-130%);
  transition: transform .9s var(--ease-soft);
}
.button:hover::before { transform: translateX(130%) }
.button:hover { transform: translateY(-3px); box-shadow: 0 18px 38px rgba(4, 18, 35, .28) }
.button:active { transform: translateY(-1px) scale(.99) }
.button .ui-icon { transition: transform .45s var(--ease-back) }
.button:hover .ui-icon { transform: translate(3px, -3px) }
.button-accent:hover { background: var(--cyan-light) }

.text-link { position: relative; border-bottom-color: transparent; transition: color .3s }
.text-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, .45);
}
.text-link::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 1;
  width: 100%;
  height: 1px;
  background: var(--cyan-light);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .6s var(--ease-expo);
}
.text-link:hover::before { transform: scaleX(1) }
.text-link .ui-icon { transition: transform .5s var(--ease-back) }
.text-link:hover .ui-icon { transform: translateY(4px) }

.footer-cta .ui-icon, .service-overlay a { transition: transform .45s var(--ease-back), color .3s }
.footer-cta:hover .ui-icon { transform: translate(3px, -3px) }
.service-overlay a:hover { color: var(--cyan-light) }

/* --------------------------------------------------------------------------
   8. Blocos e microinterações
   -------------------------------------------------------------------------- */

.service-card {
  transition: transform .8s var(--ease-expo), box-shadow .8s var(--ease-expo);
}
.service-card:hover { transform: translateY(-6px); box-shadow: 0 34px 70px rgba(4, 18, 35, .3) }

.portfolio-card { transition: transform .8s var(--ease-expo), border-color .5s }
.portfolio-card:hover { transform: translateY(-6px); border-top-color: var(--cyan) }
.portfolio-copy p { transition: color .4s }
.portfolio-card:hover .portfolio-copy p { color: var(--cyan-light) }

.live-badge::before { animation: livePulse 2.2s ease-in-out infinite }
@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(112, 228, 231, .1) }
  50%      { box-shadow: 0 0 0 8px rgba(112, 228, 231, .02) }
}

.values span { position: relative; transition: color .45s var(--ease-soft) }
.values span::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .7s var(--ease-expo);
}
.values span:hover { color: #159ca9 }
.values span:hover::after { transform: scaleX(1) }

.steps li { transition: background .5s, padding-left .5s var(--ease-expo) }
.steps li > span { transition: color .4s, transform .5s var(--ease-expo); display: inline-block }
.steps li:hover { padding-left: 10px }
.steps li:hover > span { color: var(--cyan); transform: translateX(4px) }

.authority-grid div { transition: background .5s }
.authority-grid div:hover { background: rgba(16, 191, 202, .05) }

/* --------------------------------------------------------------------------
   9. FAQ com abertura suave
   -------------------------------------------------------------------------- */

.faq-list summary span {
  display: inline-block;
  transition: transform .55s var(--ease-back), color .3s;
}
.faq-list details[data-state="open"] summary span { transform: rotate(135deg) }
.faq-list summary { transition: color .3s }
.faq-list summary:hover { color: #159ca9 }

.faq-wrap {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows .6s var(--ease-expo), opacity .45s ease;
}
.faq-list details[data-state="open"] .faq-wrap { grid-template-rows: 1fr; opacity: 1 }
.faq-inner { overflow: hidden; min-height: 0 }

/* --------------------------------------------------------------------------
   10. Rodapé
   -------------------------------------------------------------------------- */

.footer-column a { position: relative }
.footer-bottom a { transition: color .3s }
.footer-bottom a:hover { color: var(--cyan-light) }

/* --------------------------------------------------------------------------
   11. Desempenho e acessibilidade
   -------------------------------------------------------------------------- */

/* O vídeo do topo é 16:9 e as cortinas ficam nas bordas: no retrato do celular
   o centro mostraria só a janela. --hero-focus escolhe o lado (0% esquerda, 100% direita). */
:root { --hero-focus: 72% }

@media (max-width: 900px) {
  .hero .hero-video, .hero video.ambient-video { object-position: var(--hero-focus) center }

  /* Retrato: as sobreposições passam a descer de cima para baixo, acompanhando o texto,
     em vez de escurecer só o lado esquerdo como no desktop. */
  .hero-wash {
    background: linear-gradient(180deg, rgba(2, 14, 29, .74), rgba(2, 19, 37, .58) 42%, rgba(2, 17, 33, .86));
  }
  .scale-shade, .contact-shade {
    background: linear-gradient(180deg, rgba(3, 16, 31, .5), rgba(3, 16, 31, .82) 45%, rgba(3, 16, 31, .93));
  }
}

@media (max-width: 800px) {
  .hero.is-parallax .hero-copy { filter: none }
  .service-card:hover, .portfolio-card:hover { transform: none }
  .motion-ready [data-reveal] { transform: translate3d(0, 16px, 0) }
}

@media (prefers-reduced-motion: reduce) {
  .motion-ready [data-reveal],
  .motion-ready [data-reveal="stagger"] > *,
  .swi { opacity: 1 !important; transform: none !important; filter: none !important }
  .ambient-video { opacity: 1 }
  .hero-copy { opacity: 1; transform: none; filter: none }
  .hero-video { transform: scale(1.03) }
}

:where(a, button, summary):focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 2px;
}
