/* ============================================================
   HERO — Midnight Luxury + Obsidian Blue
   Paleta: #080A0E · #151A22 · #252D38 · #0B1628 · #087CFF · #F5F5F5 · #AAB2BE
   ============================================================ */

:root {
  --preto: #080A0E;
  --grafite: #151A22;
  --grafite-2: #252D38;
  --marinho: #0B1628;
  --azul: #087CFF;
  --gelo: #F5F5F5;
  --metal: #AAB2BE;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --fade-clip: 350ms;   /* transição discreta entre os dois vídeos */
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--preto); overflow: hidden; }
html { scroll-behavior: auto; }
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--gelo);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, a { -webkit-tap-highlight-color: transparent; }

/* ---------- Hero em tela cheia ---------- */
/* A página é mais alta que a tela; a tela do hero fica fixa (sticky) e a rolagem move a animação */
.track { position: relative; height: 100svh; }
.hero {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: var(--preto);
}

.stage { position: absolute; inset: 0; }

.poster, .clip {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  /* Desktop: o quadro é deslocado para a direita (o carro fica à direita, como na referência)
     e a borda esquerda se dissolve no preto da interface. O vídeo não é esticado nem alterado. */
  transform: translateX(19%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,.18) 8%, rgba(0,0,0,.55) 15%, rgba(0,0,0,.85) 21%, #000 27%);
          mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,.18) 8%, rgba(0,0,0,.55) 15%, rgba(0,0,0,.85) 21%, #000 27%);
}
.poster { z-index: 0; }
.clip--back { z-index: 0; }   /* último quadro: fallback sem vídeo */
.clip { z-index: 1; opacity: 1; transition: opacity 700ms var(--ease); }
.hero.no-frames .clip { opacity: 0; }

/* Sombra sutil só na região do texto; o showroom não é escurecido */
.scrim {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(8,10,14,.55) 0%, rgba(8,10,14,.25) 32%, rgba(8,10,14,0) 52%),
    linear-gradient(0deg, rgba(8,10,14,.45) 0%, rgba(8,10,14,0) 30%);
  opacity: 0;
  transition: opacity 900ms var(--ease);
}
.hero.is-final .scrim { opacity: 1; }

/* ---------- Cabeçalho ---------- */
.header {
  position: absolute;
  isolation: isolate;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px clamp(20px, 4vw, 56px);
  padding-top: calc(26px + env(safe-area-inset-top, 0px));
  pointer-events: none;            /* só os controles recebem toque */
}
.header > * { pointer-events: auto; }
.header::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 150px;
  z-index: -1;
  background: linear-gradient(180deg, rgba(8,10,14,.6) 0%, rgba(8,10,14,0) 100%);
  pointer-events: none;
}

.brand { display: inline-flex; flex-direction: column; text-decoration: none; color: var(--gelo); line-height: 1; }
.brand__mark {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .32em;
  text-transform: uppercase;
}
.brand__sub {
  margin-top: 6px;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .5em;
  text-transform: uppercase;
  color: var(--metal);
}

.header__actions { display: flex; align-items: center; gap: 14px; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;               /* área de toque confortável */
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--gelo);
  opacity: .85;
  cursor: default;            /* pesquisa ainda não implementada */
  border-radius: 50%;
}
.icon-btn[aria-disabled="true"] { opacity: .6; }

/* ---------- Botões ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  overflow: hidden;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: .01em;
  border-radius: 10px;
  transition: transform 300ms var(--ease), box-shadow 300ms var(--ease), background-color 300ms var(--ease), border-color 300ms var(--ease);
}
.btn::after {               /* brilho discreto no hover */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.18) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 700ms var(--ease);
}
.btn:hover::after { transform: translateX(120%); }
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible { outline: 2px solid var(--azul); outline-offset: 3px; }

.btn--ghost {
  color: var(--gelo);
  border: 1px solid rgba(8,124,255,.7);
  background: rgba(11,22,40,.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.btn--ghost:hover {
  background: rgba(8,124,255,.18);
  border-color: var(--azul);
  box-shadow: 0 0 22px -6px rgba(8,124,255,.7);
}
.btn--sm { height: 40px; padding: 0 16px; font-size: 13.5px; white-space: nowrap; }

.btn--primary {
  height: 50px;
  padding: 0 22px;
  font-size: 15.5px;
  color: #fff;
  background: var(--azul);
  box-shadow: 0 10px 30px -12px rgba(8,124,255,.8);
}
.btn--primary:hover {
  background: #1a8cff;
  box-shadow: 0 14px 36px -10px rgba(8,124,255,.95);
}

/* ---------- Conteúdo final (layout da referência) ---------- */
.content {
  position: absolute;
  z-index: 8;
  left: 5.8vw;
  top: 28vh;
  pointer-events: none;
}
.content > * { pointer-events: auto; }

.rule {
  display: block;
  width: 6.25vw;
  max-width: 100px;
  height: 3px;
  margin-bottom: clamp(16px, 3.2vh, 30px);
  background: linear-gradient(90deg, var(--azul), rgba(8,124,255,.35));
  border-radius: 2px;
}

.title {
  margin: 0;
  font-family: Manrope, Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: min(4.4vw, 7.9vh);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -.02em;
  color: var(--gelo);
}
.title__line { display: block; white-space: nowrap; }
.title em { font-style: normal; color: var(--azul); }

.lede {
  margin: clamp(14px, 2.6vh, 24px) 0 clamp(22px, 4vh, 36px);
  font-size: min(1.4vw, 2.5vh);
  line-height: 1.45;
  color: #E4E8EE;
  text-shadow: 0 1px 14px rgba(8,10,14,.55);
}

.btn--primary {
  height: min(3.6vw, 6.4vh);
  min-height: 48px;
  padding: 0 min(1.9vw, 3.4vh);
  font-size: min(1.2vw, 2.2vh);
  border-radius: 14px;
  color: #fff;
  background: var(--azul);
  box-shadow: 0 10px 30px -12px rgba(8,124,255,.8);
}
.btn--primary:hover {
  background: #1a8cff;
  box-shadow: 0 14px 36px -10px rgba(8,124,255,.95);
}
.btn--primary svg { transition: transform 300ms var(--ease); }
.btn--primary:hover svg { transform: translateX(3px); }

/* Entrada do texto: fade + subida de poucos pixels (somente com o carro estacionado) */
.rule, .title, .lede, .content .btn {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 900ms var(--ease), transform 900ms var(--ease);
}
.rule { transition-delay: 0ms; }
.title { transition-delay: 80ms; }
.lede { transition-delay: 300ms; }
.content .btn { transition-delay: 500ms; }
.hero.is-final .rule,
.hero.is-final .title,
.hero.is-final .lede,
.hero.is-final .content .btn { opacity: 1; transform: none; }
.hero.is-final .content .btn { transition-property: opacity, transform, background-color, box-shadow; }

/* Botão discreto: só aparece se o autoplay for bloqueado / movimento reduzido */
.replay {
  position: absolute;
  z-index: 9;
  right: clamp(16px, 3vw, 48px);
  bottom: calc(clamp(16px, 3vh, 32px) + env(safe-area-inset-bottom, 0px));
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  font: 500 12.5px/1 Inter, system-ui, sans-serif;
  color: var(--gelo);
  background: rgba(11,22,40,.55);
  border: 1px solid rgba(170,178,190,.35);
  border-radius: 999px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
  transition: border-color 300ms var(--ease), background-color 300ms var(--ease);
}
.replay[hidden] { display: none; }
.replay:hover { border-color: var(--azul); background: rgba(8,124,255,.18); }
.replay:focus-visible { outline: 2px solid var(--azul); outline-offset: 3px; }

/* ---------- Movimento reduzido ---------- */
@media (prefers-reduced-motion: reduce) {
  .btn, .btn::after { transition: none !important; }
}

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  .poster, .clip { object-position: 64% 50%; transform: none; -webkit-mask-image: none; mask-image: none; }
  .header { padding: 16px 18px; padding-top: calc(16px + env(safe-area-inset-top, 0px)); }
  .brand__mark { font-size: 12px; letter-spacing: .26em; }
  .brand__sub { font-size: 8.5px; letter-spacing: .42em; }
  .header__actions { gap: 8px; }
  .btn--sm { height: 38px; padding: 0 12px; font-size: 12.5px; }
  .scrim {
    background:
      linear-gradient(0deg, rgba(8,10,14,.92) 0%, rgba(8,10,14,.6) 34%, rgba(8,10,14,0) 60%),
      linear-gradient(180deg, rgba(8,10,14,.45) 0%, rgba(8,10,14,0) 18%);
  }
  .content {
    top: auto;
    bottom: calc(40px + env(safe-area-inset-bottom, 0px));
    left: 22px;
    right: 22px;
  }
  .rule { width: 56px; margin-bottom: 14px; }
  .title { font-size: clamp(34px, 10.4vw, 48px); }
  .br-d { display: none; }
  .lede { margin: 14px 0 22px; font-size: 15.5px; }
  .btn--primary { width: 100%; height: 52px; font-size: 15.5px; border-radius: 12px; }
  .replay { bottom: auto; top: calc(76px + env(safe-area-inset-top, 0px)); right: 18px; }
}

@media (max-width: 380px) {
  .brand__sub { display: none; }
}

/* ---------- Celular em retrato: faixa cinematográfica (o carro inteiro permanece visível) ---------- */
@media (max-width: 760px) and (orientation: portrait) {
  .poster, .clip {
    transform: none;
    top: 21%;
    bottom: auto;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 14%, #000 86%, transparent 100%);
            mask-image: linear-gradient(180deg, transparent 0%, #000 14%, #000 86%, transparent 100%);
  }
  .scrim {
    background: linear-gradient(0deg, rgba(8,10,14,.96) 0%, rgba(8,10,14,.82) 34%, rgba(8,10,14,0) 58%);
  }
  .btn--sm { white-space: nowrap; padding: 0 12px; }
}

@media (max-width: 760px) {
  .brand__mark { letter-spacing: .16em; }
  .brand__sub { letter-spacing: .3em; }
  .icon-btn { width: 36px; height: 40px; }
  .header__actions .btn--sm { padding: 0 11px; }
}

@media (max-width: 760px) {
  .header__actions .btn svg { display: none; }
  .header__actions .btn--sm { gap: 0; font-size: 12.5px; }
  .brand__mark { font-size: 11px; letter-spacing: .14em; }
}

/* A imagem final só aparece quando a animação termina (evita "flash" antes do 1º frame) */
.poster { opacity: 0; transition: opacity 700ms var(--ease); }
.hero.no-frames .poster { opacity: 1; }   /* foto final só como reserva (sem frames / movimento reduzido) */

