/* ==========================================================================
   YAF MKT · components.css
   Peças reutilizáveis: preloader, cursor, botões, marquee.
   ========================================================================== */

/* --------------------------------------------------------------------------
   PRELOADER
   Camada full-screen com contador. Ao terminar, a "cortina" sobe e revela
   o herói (animação em js/preloader.js).
   -------------------------------------------------------------------------- */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: var(--void);
}

/* Escondido de vez após a animação — evita capturar cliques */
.preloader.is-done { display: none; }

.preloader__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6rem;
  width: min(320px, 72vw);
}

.preloader__mark {
  width: 48px;
  height: auto;
  overflow: visible;
}
.preloader__mark polygon { fill: var(--white); }
.preloader__mark .p-arm-r { fill: var(--blue); }

.preloader__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  width: 100%;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--faint);
}

.preloader__count {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--white);
  /* tabular-nums impede o número de "tremer" enquanto conta */
  font-variant-numeric: tabular-nums;
}
.preloader__count::after { content: '%'; color: var(--blue); }

.preloader__bar {
  width: 100%;
  height: 1px;
  background: var(--line-strong);
  overflow: hidden;
}

.preloader__bar-fill {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--blue-lt));
  transform: scaleX(0);
  transform-origin: left;
}

/* A cortina cobre a tela e sobe revelando o site */
.preloader__curtain {
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: translateY(100%);
}

/* --------------------------------------------------------------------------
   CURSOR CUSTOMIZADO
   Só é ativado em dispositivos com ponteiro preciso (js/cursor.js).
   Ponto sólido + anel que segue com atraso.
   -------------------------------------------------------------------------- */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 300;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: difference;   /* garante contraste sobre qualquer fundo */
}

.cursor.is-active { opacity: 1; }

.cursor__dot,
.cursor__ring {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 999px;
  transform: translate(-50%, -50%);
}

.cursor__dot {
  width: 6px;
  height: 6px;
  background: var(--white);
}

.cursor__ring {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  transition: width 0.4s var(--ease-out), height 0.4s var(--ease-out),
              background-color 0.4s var(--ease-out), border-color 0.4s var(--ease-out);
}

/* Estado "sobre um link" — o anel cresce */
.cursor.is-hover .cursor__ring {
  width: 62px;
  height: 62px;
  background: rgba(255, 255, 255, 0.12);
  border-color: transparent;
}
.cursor.is-hover .cursor__dot { opacity: 0; }

/* Estado com rótulo (data-cursor="Ver case") — vira um disco com texto */
.cursor.is-label .cursor__ring {
  width: 92px;
  height: 92px;
  background: var(--white);
  border-color: transparent;
}
.cursor.is-label .cursor__dot { opacity: 0; }

.cursor__label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #000;
  opacity: 0;
  transition: opacity 0.25s ease;
  white-space: nowrap;
}
.cursor.is-label .cursor__label { opacity: 1; }

/* Quando o cursor customizado está ativo, esconde o nativo */
body.has-custom-cursor,
body.has-custom-cursor a,
body.has-custom-cursor button { cursor: none; }

/* --------------------------------------------------------------------------
   BOTÕES
   O preenchimento entra de baixo para cima no hover (::before com scaleY).
   -------------------------------------------------------------------------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 1.05em 1.9em;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-size: var(--fs-small);
  font-weight: 500;
  letter-spacing: 0.01em;
  overflow: hidden;
  isolation: isolate;
  transition: border-color 0.4s ease, color 0.4s ease;
  white-space: nowrap;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--white);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.5s var(--ease-out);
}

.btn:hover::before { transform: scaleY(1); }
.btn:hover { color: var(--void); border-color: transparent; }

.btn__label { position: relative; }

.btn__arrow {
  font-size: 1.05em;
  line-height: 1;
  transition: transform 0.45s var(--ease-out);
}
.btn:hover .btn__arrow { transform: translate(2px, -2px); }

/* Seta que aponta para baixo não deve subir no hover */
.btn--primary .btn__arrow { transition: transform 0.45s var(--ease-out); }
.btn--primary:hover .btn__arrow { transform: translateY(3px); }

/* Variantes */
.btn--primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.btn--primary::before { background: var(--white); }

.btn--ghost { color: var(--white); }

.btn--sm {
  padding: 0.8em 1.4em;
  font-size: var(--fs-label);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

/* Botão de destaque — o CTA final de WhatsApp */
.btn--lg {
  padding: 1.15em 2.2em;
  font-size: var(--fs-body);
  font-weight: 500;
}

/* Ícone dentro do botão (ex.: glifo do WhatsApp).
   em em vez de px: o ícone acompanha o tamanho do texto do botão. */
.btn__icon {
  width: 1.3em;
  height: 1.3em;
  flex-shrink: 0;
  position: relative;
}

/* --------------------------------------------------------------------------
   MARQUEE — faixa de serviços em loop infinito
   O deslocamento é feito por GSAP (js/animations.js) e reage à velocidade
   do scroll, então aqui só entra o visual.
   -------------------------------------------------------------------------- */
.marquee {
  position: relative;
  z-index: 2;
  padding: clamp(1.4rem, 2.4vw, 2.2rem) 0;
  border-block: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(47, 99, 255, 0.05), transparent);
  overflow: hidden;
  /* esmaece as pontas para o texto não "cortar" seco na borda */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.marquee__track {
  display: flex;
  width: max-content;
  will-change: transform;
}

.marquee__group {
  display: flex;
  align-items: center;
  gap: clamp(1.4rem, 3vw, 3rem);
  padding-right: clamp(1.4rem, 3vw, 3rem);
  flex-shrink: 0;
}

.marquee__group span {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.4vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  white-space: nowrap;
  color: var(--white);
}

.marquee__group i {
  font-style: normal;
  font-size: clamp(0.7rem, 1.2vw, 1rem);
  color: var(--blue);
}

/* --------------------------------------------------------------------------
   MEDIDOR (usado na seção Stack)
   -------------------------------------------------------------------------- */
.stack__meter {
  position: relative;
  height: 3px;
  background: rgba(140, 170, 255, 0.16);   /* trilho visível: sem ele não dá
                                              para comparar 97% com 90% */
  overflow: hidden;
  border-radius: 3px;
}

.stack__meter-fill {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--blue), var(--blue-lt));
  transform: scaleX(0);
  transform-origin: left;
}
