/* ============================================================
   VICTORIOUS MOTORCYCLES — ESTILOS
   Mobile first. Só transform e opacity são animados.
   ============================================================ */

/* ---------- Variáveis: cores e medidas em um lugar só ---------- */
:root {
  --vermelho:        #d10a0a;
  --vermelho-claro:  #ff2a2a;
  --vermelho-escuro: #7a0505;
  --preto:           #000000;
  --branco:          #ffffff;
  --cinza:           #9a9a9a;

  --largura-max: 480px;   /* largura do conteúdo no desktop */
  --raio-botao:  40px;    /* cantos arredondados dos botões */

  /* Safe areas do iPhone (notch e barra inferior) */
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left:   env(safe-area-inset-left, 0px);
  --safe-right:  env(safe-area-inset-right, 0px);
}

/* ---------- Reset enxuto ---------- */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--preto);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--branco);
  font-family: "Oswald", "Arial Narrow", "Helvetica Neue Condensed", Impact, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;  /* tiramos o flash cinza do toque no mobile */
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }


/* ============================================================
   CAMADAS DE FUNDO
   Todas com position: fixed, atrás do conteúdo.
   ============================================================ */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* 1) A foto */
.bg__foto {
  position: absolute;
  inset: 0;
  background-image: url("assets/fundo.jpg");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  will-change: transform;
  transform: scale(1);
}

/* Zoom lento (Ken Burns) — ligado pela classe vinda do config.js */
.bg__foto.is-zoom {
  animation: kenburns 20s ease-in-out infinite alternate;
}

@keyframes kenburns {
  from { transform: scale(1); }
  to   { transform: scale(1.08); }
}

/* 2) Escurecimento geral, para o texto ficar legível */
.bg__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.70) 0%,
    rgba(0, 0, 0, 0.58) 35%,
    rgba(0, 0, 0, 0.55) 68%,
    rgba(0, 0, 0, 0.20) 86%,
    rgba(0, 0, 0, 0.10) 100%
  );
}

/* 3) Vinheta: escurece os cantos */
.bg__vinheta {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 78% 62% at 50% 42%,
    rgba(0, 0, 0, 0) 45%,
    rgba(0, 0, 0, 0.45) 80%,
    rgba(0, 0, 0, 0.85) 100%
  );
}

/* 4) Névoa vermelha translúcida em deriva lenta */
.bg__nevoa {
  position: absolute;
  top: -20%;
  left: -40%;
  width: 180%;
  height: 140%;
  opacity: 0;
  background:
    radial-gradient(ellipse 32% 26% at 22% 30%, rgba(209, 10, 10, 0.30), transparent 70%),
    radial-gradient(ellipse 28% 30% at 74% 62%, rgba(150, 12, 12, 0.26), transparent 70%),
    radial-gradient(ellipse 40% 20% at 48% 88%, rgba(209, 10, 10, 0.22), transparent 70%);
  will-change: transform;
}

.bg__nevoa.is-ativa {
  opacity: 1;
  animation: derivaNevoa 34s ease-in-out infinite alternate;
}

@keyframes derivaNevoa {
  from { transform: translate3d(-4%, 2%, 0) scale(1);    }
  to   { transform: translate3d(6%, -3%, 0) scale(1.12); }
}

/* 5) Partículas (brasas). Os elementos são criados por script.js */
.bg__particulas { position: absolute; inset: 0; }

.particula {
  position: absolute;
  bottom: -20px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  opacity: 0;
  will-change: transform, opacity;
  animation-name: subirBrasa;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes subirBrasa {
  0%   { transform: translate3d(0, 0, 0) scale(0.6);                  opacity: 0; }
  12%  { opacity: var(--brilho, 0.85); }
  70%  { opacity: var(--brilho, 0.85); }
  100% { transform: translate3d(var(--desvio, 14px), -105vh, 0) scale(1); opacity: 0; }
}

/* Pausa geral das animações do fundo (aba escondida) */
.bg.is-pausado .bg__foto,
.bg.is-pausado .bg__nevoa,
.bg.is-pausado .particula {
  animation-play-state: paused;
}


/* ============================================================
   ESTRUTURA DA PÁGINA
   ============================================================ */
.pagina {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--largura-max);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding:
    calc(var(--safe-top) + 18px)
    calc(var(--safe-right) + 20px)
    calc(var(--safe-bottom) + 10px)
    calc(var(--safe-left) + 20px);
}


/* ---------- Logo ---------- */
.topo {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.logo {
  width: min(70%, 292px);
  height: auto;
  filter: drop-shadow(0 6px 22px rgba(0, 0, 0, 0.85));
}


/* ---------- Bandeiras UK + Brasil ---------- */
.bandeiras {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.bandeiras[hidden] { display: none; }

.bandeiras svg {
  width: 38px;
  height: auto;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.bandeiras__linha {
  width: 110px;
  height: 2px;
  background: var(--vermelho);
  box-shadow: 0 0 6px rgba(209, 10, 10, 0.9);
}


/* ---------- Título e subtítulo ---------- */
.cabecalho {
  text-align: center;
  margin-top: 16px;
}

.titulo {
  margin: 0;
  font-size: clamp(30px, 9vw, 42px);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.9);
}

.subtitulo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 10px 0 0;
  color: var(--cinza);
  font-size: clamp(13px, 4vw, 17px);
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
}

/* O último caractere "empurra" o texto por causa do letter-spacing;
   a margem negativa recentraliza. */
.subtitulo__texto { margin-right: -0.34em; }

.subtitulo__traco {
  flex: 1 1 auto;
  max-width: 62px;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--vermelho));
  box-shadow: 0 0 5px rgba(209, 10, 10, 0.7);
}

.subtitulo__traco:last-child {
  background: linear-gradient(to left, transparent, var(--vermelho));
}


/* ============================================================
   BOTÕES
   ============================================================ */
.botoes {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.botao {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 62px;
  padding: 0 16px;
  border: 2px solid var(--vermelho);
  border-radius: var(--raio-botao);
  background: rgba(8, 8, 8, 0.62);
  box-shadow:
    0 0 10px rgba(209, 10, 10, 0.45),
    inset 0 0 14px rgba(209, 10, 10, 0.16);
  color: var(--branco);
  text-decoration: none;
  overflow: hidden;                 /* segura o ripple dentro do botão */
  isolation: isolate;
  will-change: transform;
  transform: translateZ(0);
  transition:
    transform 150ms ease,
    box-shadow 200ms ease,
    border-color 200ms ease;
}

/* Ícone à esquerda */
.botao__icone {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
}

.botao__icone svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Divisor vertical fino */
.botao__divisor {
  flex: 0 0 auto;
  width: 1px;
  height: 30px;
  margin: 0 4px 0 14px;
  background: rgba(255, 255, 255, 0.28);
}

/* Texto centralizado no espaço que sobra */
.botao__texto {
  flex: 1 1 auto;
  text-align: center;
  font-size: clamp(17px, 5vw, 21px);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0 6px;
}

/* Seta ">" à direita */
.botao__seta {
  flex: 0 0 auto;
  width: 16px;
  height: 22px;
  color: var(--branco);
  opacity: 0.95;
}

/* --- Hover no desktop (só em aparelhos com mouse) --- */
@media (hover: hover) and (pointer: fine) {
  .botao:hover {
    transform: scale(1.025);
    border-color: var(--vermelho-claro);
    box-shadow:
      0 0 22px rgba(209, 10, 10, 0.85),
      inset 0 0 20px rgba(209, 10, 10, 0.28);
  }
}

/* --- Foco pelo teclado --- */
.botao:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 3px;
}

/* --- Afundar no toque/clique --- */
.botao.is-pressionado {
  transform: scale(0.96);
}

/* --- Flash da borda no momento do toque --- */
.botao.is-flash {
  border-color: #ff5555;
  box-shadow:
    0 0 34px rgba(255, 42, 42, 0.95),
    inset 0 0 26px rgba(255, 42, 42, 0.4);
}

/* --- Onda de luz (ripple) --- */
.ripple {
  position: absolute;
  top: 0;
  left: 0;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;          /* centraliza no ponto do toque */
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(
    circle,
    rgba(255, 90, 90, 0.85) 0%,
    rgba(209, 10, 10, 0.5) 45%,
    rgba(209, 10, 10, 0) 72%
  );
  will-change: transform, opacity;
  animation: ondaRipple 500ms ease-out forwards;
}

@keyframes ondaRipple {
  from { transform: translate3d(var(--x), var(--y), 0) scale(0.2); opacity: 0.9; }
  to   { transform: translate3d(var(--x), var(--y), 0) scale(var(--escala, 20)); opacity: 0; }
}


/* ============================================================
   RODAPÉ: seta para baixo
   ============================================================ */
.rodape {
  flex: 1 1 auto;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 110px;                /* espaço para a moto da foto aparecer */
  padding-bottom: 10px;
}

.seta {
  width: 30px;
  height: 15px;
  color: var(--vermelho);
  filter: drop-shadow(0 0 6px rgba(209, 10, 10, 0.9));
  opacity: 0.85;
}

.seta.is-pulsando {
  animation: pulsarSeta 2.4s ease-in-out infinite;
}

@keyframes pulsarSeta {
  0%, 100% { transform: translate3d(0, 0, 0);   opacity: 0.55; }
  50%      { transform: translate3d(0, 5px, 0); opacity: 1; }
}


/* ============================================================
   ANIMAÇÃO DE ENTRADA
   Os elementos começam invisíveis e sobem um pouco.
   O script tira a classe em cascata.
   ============================================================ */
/* Sem JavaScript, nada fica escondido: a regra só vale com a
   classe "com-js", que o próprio index.html adiciona. */
.com-js .revelar {
  opacity: 0;
  transform: translate3d(0, 16px, 0);
}

.animacao-ligada .revelar {
  transition: opacity 620ms ease, transform 620ms cubic-bezier(0.22, 1, 0.36, 1);
}

.revelar.is-visivel {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}


/* ============================================================
   TELAS MAIORES
   ============================================================ */
@media (min-width: 481px) {
  .pagina { padding-top: 28px; }
  .logo   { width: min(72%, 330px); }
}

/* Telas baixinhas (iPhone SE e afins): apertamos os espaços */
@media (max-height: 700px) {
  .logo        { width: min(62%, 250px); }
  .cabecalho   { margin-top: 14px; }
  .botoes      { margin-top: 18px; gap: 11px; }
  .botao       { min-height: 55px; }
  .botao__icone{ width: 36px; height: 36px; }
  .rodape      { min-height: 56px; }
}


/* ============================================================
   ACESSIBILIDADE: usuário pediu menos movimento
   Desliga zoom, partículas, névoa, entrada e o "afundar".
   O clique vira só uma mudança de brilho.
   ============================================================ */
@media (prefers-reduced-motion: reduce) {

  .bg__foto.is-zoom,
  .bg__nevoa.is-ativa,
  .seta.is-pulsando {
    animation: none !important;
  }

  .bg__nevoa  { opacity: 0 !important; }
  .particula  { display: none !important; }

  .com-js .revelar,
  .revelar {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .botao {
    transition: box-shadow 120ms linear, border-color 120ms linear;
  }

  .botao:hover,
  .botao.is-pressionado {
    transform: none !important;
  }

  .ripple { display: none !important; }
}
