/* ============================================================
   BRAVUS FX — camada de experiência "máquina"
   Ignição · Speed streaks · HUD · Cursor · Marquee · Wipe
   ============================================================ */

/* ---------- Ignição (preloader) ---------- */
.ignition {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: #060608;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  transition: opacity 0.45s cubic-bezier(0.65, 0, 0.35, 1), visibility 0.45s;
}
.ignition.off { opacity: 0; visibility: hidden; pointer-events: none; }
.ignition__logo { height: 40px; opacity: 0.95; }
.ignition__boot {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted-2);
  min-height: 1.2em;
}
.ignition__boot .ok { color: var(--green); }
.ignition__rpm {
  width: min(420px, 72vw);
  height: 3px;
  background: #1c1c22;
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}
.ignition__rpm i {
  position: absolute;
  inset: 0 100% 0 0;
  background: linear-gradient(90deg, #6d6d78, #fff 55%, var(--red));
  border-radius: 2px;
}
.ignition__redline {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(2rem, 6vw, 3.2rem);
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  line-height: 1;
}
.ignition__redline small { font-size: 0.8rem; color: var(--muted-2); letter-spacing: 0.3em; margin-left: 8px; }
.ignition.redline .ignition__redline { color: var(--red); text-shadow: 0 0 24px var(--red-glow); }

/* ---------- Wipe de transição ---------- */
.wipe {
  position: fixed;
  inset: 0;
  z-index: 998;
  background: var(--red);
  transform: scaleY(0);
  transform-origin: bottom;
  pointer-events: none;
}

/* ---------- Speed streaks (canvas fixo) ---------- */
#speedfx {
  position: fixed;
  inset: 0;
  z-index: 89;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.9;
}
html.no-motion #speedfx { display: none; }

/* ---------- Grain / scanline ---------- */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 88;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.7'/%3E%3C/svg%3E");
  animation: grain 0.7s steps(4) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2%, 3%); }
  50% { transform: translate(3%, -2%); }
  75% { transform: translate(-3%, -3%); }
  100% { transform: translate(2%, 2%); }
}
html.no-motion .grain { animation: none; }

/* ---------- Gear HUD ---------- */
.gearhud {
  position: fixed;
  left: 22px;
  bottom: 22px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  pointer-events: none;
  mix-blend-mode: difference;
}
.gearhud__gear {
  font-weight: 700;
  font-size: 2rem;
  line-height: 1;
  min-width: 1.2ch;
  text-align: center;
  color: var(--text);
}
.gearhud.shift .gearhud__gear { animation: gearshift 0.28s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes gearshift {
  0% { transform: translateY(0.4em); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
.gearhud__meta {
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.7;
}
.gearhud__meta b { color: var(--text); font-weight: 600; }
@media (max-width: 860px) { .gearhud { display: none; } }

/* ---------- Cursor custom ---------- */
html.has-cursor, html.has-cursor a, html.has-cursor button, html.has-cursor select { cursor: none; }
.cur-dot, .cur-ring {
  position: fixed;
  top: 0; left: 0;
  z-index: 997;
  pointer-events: none;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.cur-dot {
  width: 6px; height: 6px;
  background: var(--red);
}
.cur-ring {
  width: 38px; height: 38px;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  transition: width 0.25s, height 0.25s, border-color 0.25s, background 0.25s;
  display: grid;
  place-items: center;
}
.cur-ring span {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #060608;
  opacity: 0;
  transition: opacity 0.2s;
  white-space: nowrap;
}
.cur-ring.hover { width: 56px; height: 56px; border-color: var(--red); }
.cur-ring.label { width: 64px; height: 64px; background: #fff; border-color: #fff; }
.cur-ring.label span { opacity: 1; }

/* ---------- Marquee cinético (velocity skew) ---------- */
.vmarquee {
  overflow: hidden;
  padding-block: clamp(18px, 3vw, 38px);
  border-block: 1px solid var(--line);
  background: var(--bg-2);
}
.vmarquee__row {
  display: flex;
  gap: 0;
  width: max-content;
  will-change: transform;
}
.vmarquee__row + .vmarquee__row { margin-top: 8px; }
.vmarquee__chunk {
  display: flex;
  align-items: center;
  flex: none;
  font-family: var(--font-display);
  font-variation-settings: "wdth" 125;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  font-size: clamp(3rem, 9vw, 7.5rem);
  line-height: 0.95;
  letter-spacing: 0.01em;
  padding-right: 0.6em;
  white-space: nowrap;
}
.vmarquee__chunk .x { color: var(--red); font-style: normal; padding: 0 0.28em; font-size: 0.5em; }
.vmarquee__row--outline .vmarquee__chunk {
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.22);
}
.vmarquee__row--outline .vmarquee__chunk .x { -webkit-text-stroke: 0; color: var(--red); }

/* ---------- Hero vídeo + HUD ---------- */
.hero--video {
  align-items: flex-end;
  padding-top: 144px; /* folga sob o header fixo (112px) */
}
.hero--video h1.h-display { font-size: clamp(2.3rem, 5.6vw, 4.7rem); }
.hero--video .hero__badge { margin-bottom: 18px; }
.hero--video .hero__sub { margin-top: 16px; }
.hero--video .hero__ctas { margin-top: 28px; }
@media (max-height: 760px) {
  .hero--video h1.h-display { font-size: clamp(2rem, 5vw, 3.9rem); }
  .telemetry { padding: 10px 16px; margin-top: 22px; }
  .hero--video { padding-bottom: 40px; }
}
.hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  filter: saturate(1.05) contrast(1.08) brightness(0.62);
}
.hero--video .hero__bg::after,
.hero__shade {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(6,6,8,0.55) 0%, rgba(6,6,8,0.1) 40%, rgba(6,6,8,0.88) 84%, var(--bg) 100%),
    radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(6,6,8,0.55) 100%);
  pointer-events: none;
}
.hero__scanline {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(255,255,255,0.028) 0 1px, transparent 1px 4px);
  mix-blend-mode: overlay;
}

.hero__h1--kinetic {
  font-style: italic;
  font-variation-settings: "wdth" 125;
  font-weight: 900;
  letter-spacing: 0.005em;
}
.hero__h1--kinetic .line > span { will-change: transform, filter; }

/* Telemetria (cluster de instrumentos no rodapé do hero) */
.telemetry {
  position: relative;
  margin-top: clamp(30px, 5vh, 54px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(6, 6, 8, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 12px;
  padding: 0;
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  overflow: hidden;
  flex-direction: column;
}
.telemetry b { color: var(--text); font-weight: 600; }
.telemetry .accent { color: var(--red); }
.telemetry__group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(14px, 2vw, 30px);
  padding: 13px clamp(18px, 2.4vw, 30px);
  width: 100%;
}
.telemetry__group + .telemetry__group { border-top: 1px solid rgba(255, 255, 255, 0.12); }
.telemetry__item { display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.telemetry__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(37, 211, 102, 0.8);
  animation: pulse 2s infinite;
}
.telemetry__rpm { display: flex; align-items: flex-end; gap: 2.5px; height: 16px; }
.telemetry__rpm i {
  width: 3px;
  background: var(--muted-2);
  border-radius: 1px;
  height: 30%;
}
.telemetry__rpm i.hot { background: var(--red); }
.telemetry__speed { font-size: 1rem; font-weight: 700; color: var(--text); min-width: 5.5ch; }
.telemetry__speed small { font-size: 0.6rem; color: var(--muted-2); }

/* Botão de som do vídeo */
.soundtoggle {
  position: absolute;
  right: var(--gutter);
  bottom: 96px;
  z-index: 3;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(6, 6, 8, 0.5);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.25s, transform 0.25s;
}
.soundtoggle:hover { border-color: var(--red); transform: scale(1.06); }
.soundtoggle svg { width: 19px; height: 19px; }
.soundtoggle .on-icon { display: none; }
.soundtoggle.on .on-icon { display: block; }
.soundtoggle.on .off-icon { display: none; }
@media (max-width: 860px) { .soundtoggle { bottom: auto; top: 96px; } }

/* ---------- HUD brackets (cantos de painel) ---------- */
.hud { position: relative; }
.hud::before, .hud::after,
.hud > .hud-b::before, .hud > .hud-b::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  border: 2px solid rgba(225, 29, 38, 0.75);
  pointer-events: none;
}
.hud::before { top: -2px; left: -2px; border-right: 0; border-bottom: 0; }
.hud::after { top: -2px; right: -2px; border-left: 0; border-bottom: 0; }
.hud > .hud-b::before { bottom: -2px; left: -2px; border-right: 0; border-top: 0; }
.hud > .hud-b::after { bottom: -2px; right: -2px; border-left: 0; border-top: 0; }

/* ---------- Cluster do configurador (instrumentos) ---------- */
.gain-card { transition: border-color 0.3s, box-shadow 0.4s; }
.gain-card--tuned .gain-card__hp {
  color: var(--text);
  text-shadow: 0 0 18px rgba(225, 29, 38, 0.55);
}
.gain-card__gauge { margin-top: 16px; width: 100%; height: auto; display: block; }
.gain-card__gauge .g-track { stroke: #232329; }
.gain-card__gauge .g-fill { stroke: var(--muted-2); }
.gain-card--tuned .gain-card__gauge .g-fill { stroke: var(--red); filter: drop-shadow(0 0 6px rgba(225,29,38,0.7)); }
.gain-card__gauge .g-redline { stroke: rgba(225, 29, 38, 0.35); }
.gain-card__gauge text {
  font-family: var(--font-mono);
  fill: var(--muted-2);
  font-size: 7px;
  letter-spacing: 0.1em;
}

/* ---------- Rail horizontal de serviços (arrastável) ---------- */
.rail-section { overflow: hidden; }
.rail {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 18px;
  margin-inline: calc(var(--gutter) * -1);
  padding-inline: var(--gutter);
  scrollbar-width: none;
  cursor: grab;
}
.rail::-webkit-scrollbar { display: none; }
.rail.dragging { cursor: grabbing; scroll-snap-type: none; }
.rail .svc {
  flex: none;
  width: clamp(280px, 30vw, 420px);
  min-height: 300px;
  scroll-snap-align: start;
  user-select: none;
}
.rail .svc__num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--red);
}

/* ---------- Velocity skew targets ---------- */
[data-vskew] { will-change: transform; }

/* ---------- Página interna: hero com tipo cinético ---------- */
.page-hero .h-display { font-style: italic; font-variation-settings: "wdth" 125; font-weight: 900; }

/* ---------- Terminal decode (unlock) ---------- */
.decode {
  font-family: var(--font-mono);
  color: var(--green);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
}

/* ---------- Grid de vídeos verticais (revisão / dyno) ---------- */
.vgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.vcard {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 80% at 50% 30%, #16161c, #0a0a0c 70%);
}
.vcard__v { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; z-index: 1; }
.vcard__grad {
  position: absolute; inset: 0; z-index: 2;
  background: linear-gradient(180deg, transparent 55%, rgba(6,6,8,0.85));
  pointer-events: none;
}
.vcard__cap {
  position: absolute; left: 18px; right: 18px; bottom: 16px; z-index: 3;
}
.vcard__cap b {
  display: block;
  font-family: var(--font-display);
  font-variation-settings: "wdth" 115;
  font-weight: 800; text-transform: uppercase;
  font-size: 1.02rem;
}
.vcard__cap span {
  font-family: var(--font-mono);
  font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted);
}
@media (max-width: 860px) {
  .vgrid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .vgrid { grid-template-columns: 1fr; max-width: 340px; margin-inline: auto; }
}
/* grid misto (coding: 1 vertical + 1 landscape) */
.vgrid--mixed { grid-template-columns: 0.82fr 1.18fr; align-items: start; }
.vcard--portrait { aspect-ratio: 9 / 16; }
.vcard--wide { aspect-ratio: 16 / 9; }
@media (max-width: 860px) {
  .vgrid--mixed { grid-template-columns: 1fr; max-width: 420px; margin-inline: auto; }
}

/* ---------- Carrossel de depoimentos (arrastável) ---------- */
.tcarousel {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 16px;
  margin-inline: calc(var(--gutter) * -1);
  padding-inline: var(--gutter);
  scrollbar-width: none;
  cursor: grab;
}
.tcarousel::-webkit-scrollbar { display: none; }
.tcarousel.dragging { cursor: grabbing; scroll-snap-type: none; }
.tcarousel .tcard {
  flex: none;
  width: clamp(300px, 33vw, 400px);
  scroll-snap-align: start;
  user-select: none;
}
.tcard__top { display: flex; align-items: center; justify-content: space-between; }
.tcard__g { width: 20px; height: 20px; flex: none; }
.google-badge b { color: var(--red); }

/* ---------- Seção BMW M2 → CS (coding) ---------- */
.m2cs { position: relative; overflow: hidden; }
.m2cs::before {
  content: "";
  position: absolute; inset: -20% -10% auto;
  height: 120%;
  background: radial-gradient(50% 60% at 22% 30%, rgba(225,29,38,0.12), transparent 60%);
  pointer-events: none;
}
.m2cs__grid {
  position: relative;
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: clamp(28px, 5vw, 68px);
  align-items: center;
}
.m2cs__viz {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 0;
  overflow: hidden;
  aspect-ratio: 4 / 5;
}
.m2cs__video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cluster { width: 100%; height: auto; display: block; }
.m2cs__status {
  text-align: center;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.3s;
}
.cluster.is-cs ~ .m2cs__status,
.m2cs__viz.is-cs .m2cs__status { color: var(--red); }
.m2cs__fronts { margin-top: 26px; display: grid; gap: 16px; }
.m2cs__front {
  border-left: 2px solid rgba(225,29,38,0.5);
  padding-left: 18px;
}
.m2cs__front strong { display: block; font-size: 1.02rem; margin: 3px 0 5px; }
.m2cs__front p { color: var(--muted); font-size: 0.92rem; }
.m2cs__tag {
  font-family: var(--font-mono);
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--red);
}
.m2cs__note {
  margin-top: 26px;
  font-size: 0.94rem;
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--bg-2);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.m2cs__note strong { color: var(--text); }
.m2cs__note a { color: var(--red); }
@media (max-width: 900px) {
  .m2cs__grid { grid-template-columns: 1fr; }
}

/* ---------- Cards de vídeo do YouTube ---------- */
.ytcard {
  flex: none;
  width: clamp(280px, 34vw, 440px);
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  scroll-snap-align: start;
  border: 1px solid var(--line);
  background: #000;
  user-select: none;
}
.ytcard img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease-out); }
.ytcard:hover img { transform: scale(1.05); }
.ytcard::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(6,6,8,0.1) 0%, transparent 30%, rgba(6,6,8,0.85) 100%);
  pointer-events: none;
}
.ytcard__play {
  position: absolute; top: 50%; left: 50%;
  width: 58px; height: 58px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 8px 30px -6px var(--red-glow);
  display: grid; place-items: center;
  transition: transform 0.3s var(--ease-out);
  z-index: 1;
}
.ytcard:hover .ytcard__play { transform: translate(-50%, -50%) scale(1.12); }
.ytcard__play::before {
  content: "";
  border-style: solid;
  border-width: 9px 0 9px 15px;
  border-color: transparent transparent transparent #fff;
  margin-left: 3px;
}
.ytcard__name {
  position: absolute; left: 18px; right: 18px; bottom: 15px;
  z-index: 1;
  font-family: var(--font-display);
  font-variation-settings: "wdth" 112;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.98rem;
  line-height: 1.15;
}

/* ---------- Lightbox de vídeo ---------- */
.ytlb { position: fixed; inset: 0; z-index: 995; display: none; }
.ytlb.open { display: grid; place-items: center; }
.ytlb__bg {
  position: absolute; inset: 0;
  background: rgba(6, 6, 8, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.ytlb__frame {
  position: relative;
  width: min(1040px, 92vw);
  aspect-ratio: 16 / 9;
  z-index: 1;
}
.ytlb__embed, .ytlb__embed iframe {
  width: 100%; height: 100%;
  border: 0;
  border-radius: 14px;
  display: block;
}
.ytlb__close {
  position: absolute; top: -46px; right: 0;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: grid; place-items: center;
}
.ytlb__close:hover { border-color: var(--red); color: var(--red); }

@media (prefers-reduced-motion: reduce) {
  .grain, #speedfx, .cur-dot, .cur-ring { display: none !important; }
}
