/* ==========================================================================
   Abertura, detalhes e moto inteira com as fotografias enviadas pela CR.
   As fotos são usadas como vieram (sem edição): só enquadramento por CSS.
   O JS atualiza --p (0 → 1) em cada seção [data-scroll]; o movimento usa
   apenas transform e opacity, que são leves no celular.
   ========================================================================== */

.photo { margin: 0; overflow: hidden; background: #000; }
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, 50% 50%); }
.photo.is-missing { visibility: hidden; }

/* ---------- 1. abertura ---------- */
.opening { --p: 0; position: relative; height: 175vh; background: #000; color: #fff; }
.opening__sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
/* a foto é quadrada: no computador ocupa um painel à direita, na altura da tela, sem ampliar */
.opening__media {
  position: absolute; top: 0; bottom: 0; right: 0;
  width: min(62vw, 100svh * 1.02);
  --focus: 58% 50%;
}
.opening__media img {
  transform: scale(calc(1.03 + var(--p) * 0.08)) translate3d(calc(var(--p) * -2%), calc(var(--p) * -4%), 0);
  transform-origin: 62% 50%;
  will-change: transform;
}
/* a borda esquerda da foto se funde ao preto; escurece até o preto ao sair (sem clarão) */
.opening__shade {
  position: absolute; top: 0; bottom: 0; right: 0; width: min(62vw, 100svh * 1.02); pointer-events: none;
  background:
    linear-gradient(90deg, #000 0%, rgba(0, 0, 0, 0.4) 9%, rgba(0, 0, 0, 0) 26%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0) 26%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 20%);
}
.opening__shade::after { content: ''; position: absolute; inset: 0; background: #000; opacity: clamp(0, calc((var(--p) - 0.12) * 1.05), 0.9); }
/* palavra gigante ao fundo, como na referência editorial */
.opening__word {
  position: absolute; left: 0; bottom: 5vh; white-space: nowrap; pointer-events: none;
  font-family: var(--font-display); font-weight: 800; font-style: italic; text-transform: uppercase;
  font-size: clamp(7rem, 22vw, 21rem); line-height: 0.8; letter-spacing: -0.02em;
  color: rgba(227, 6, 19, 0.14);
  transform: translate3d(calc(3vw - var(--p) * 20vw), 0, 0);
}

.hero {
  position: absolute; z-index: 2;
  left: max(var(--gutter), env(safe-area-inset-left, 0px), calc((100vw - var(--container)) / 2 + var(--gutter)));
  top: calc(var(--header-h) + env(safe-area-inset-top, 0px) + clamp(1rem, 7vh, 5rem));
  width: min(32rem, 40vw);
  opacity: clamp(0, calc(1 - var(--p) * 2.2), 1);
  transform: translate3d(0, calc(var(--p) * -70px), 0);
}
.hero__logo { width: clamp(72px, 7vw, 96px); height: auto; margin-bottom: 1.25rem; border-radius: 50%; filter: drop-shadow(0 8px 28px rgba(227, 6, 19, 0.35)); }
.hero__title {
  font-family: var(--font-display); font-weight: 800; font-style: italic; text-transform: uppercase;
  font-size: clamp(2.8rem, 5.8vw, 5.8rem); line-height: 0.86; letter-spacing: -0.01em;
  text-wrap: balance; text-shadow: 0 2px 24px rgba(0, 0, 0, 0.6);
}
.hero__text { margin-top: 1.1rem; font-size: var(--fs-lg); line-height: 1.45; color: #fff; max-width: 26rem; text-shadow: 0 1px 14px rgba(0, 0, 0, 0.9); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.9rem 1.3rem; margin-top: 1.8rem; padding-left: 0.4rem; }

.scroll-cue {
  position: absolute; z-index: 3; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 1rem);
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
  min-height: 44px; padding: 0.25rem 0.75rem; white-space: nowrap;
  font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; letter-spacing: 0.08em; text-transform: uppercase;
  text-decoration: none; color: #fff; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.9);
  opacity: clamp(0, calc(1 - var(--p) * 6), 1);
}
.scroll-cue .icon { width: 20px; height: 20px; color: var(--red); }
@media (prefers-reduced-motion: no-preference) { .scroll-cue .icon { animation: cue 1.8s var(--ease) infinite; } }
@keyframes cue { 0%, 100% { transform: translateY(-3px); } 50% { transform: translateY(5px); } }

/* ---------- 2. detalhes: carrossel (a pessoa controla; nada avança sozinho) ---------- */
.details { position: relative; background: #000; color: #fff; padding-block: clamp(4.5rem, 10vw, 8rem) clamp(3.5rem, 8vw, 6rem); }
.details__inner { --h: min(54svh, 34rem); width: min(100%, var(--container)); margin-inline: auto; padding-inline: var(--gutter); display: flex; flex-direction: column; align-items: center; }
.beat {
  margin: 0; align-self: flex-start; max-width: 30rem;
  font-family: var(--font-display); font-weight: 800; font-style: italic; text-transform: uppercase;
  font-size: clamp(2.2rem, 5vw, 4rem); line-height: 0.92; letter-spacing: -0.005em; text-wrap: balance; color: #fff;
}
.beat::before { content: ''; display: block; width: 3.5rem; height: 3px; margin-bottom: 1.1rem; background: var(--red); transform: skewX(var(--slant)); }
.beat--sub { align-self: center; text-align: center; font-size: clamp(1.1rem, 2.4vw, 1.6rem); color: rgba(255, 255, 255, 0.78); margin-top: clamp(1.25rem, 3vw, 2rem); max-width: 26rem; }
.beat--sub::before { margin-inline: auto; }

.carousel { position: relative; width: 100%; margin-top: clamp(1.75rem, 4vw, 3rem); }
.slides {
  list-style: none; margin: 0; padding: 0; display: flex; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
}
.slides::-webkit-scrollbar { display: none; }
.slides:focus-visible { outline-offset: 6px; }
.slide { flex: none; width: 100%; display: flex; justify-content: center; align-items: center; height: var(--h); scroll-snap-align: center; scroll-snap-stop: always; }
/* a foto mantém a proporção original (nada é cortado) e ganha respiro ao redor */
.card {
  position: relative; border-radius: 4px; aspect-ratio: var(--r);
  height: auto; max-height: 100%; width: min(86%, calc(var(--h) * var(--r)));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  opacity: 0.28; transform: translate3d(0, 0, 0) scale(0.985);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}
.slide.is-active .card { opacity: 1; transform: none; }
.card::after { content: ''; position: absolute; left: 0; bottom: 0; width: 34%; height: 3px; background: var(--red); }

.arrow {
  position: absolute; top: 50%; z-index: 2; width: 48px; height: 48px; margin-top: -24px; display: grid; place-items: center; padding: 0;
  color: #fff; background: rgba(0, 0, 0, 0.55); border: 1px solid rgba(255, 255, 255, 0.28); border-radius: 50%; cursor: pointer;
  transition: opacity 0.25s var(--ease), border-color 0.25s var(--ease), background-color 0.25s var(--ease);
}
.arrow svg { width: 22px; height: 22px; }
.arrow:hover { border-color: var(--red); background: rgba(227, 6, 19, 0.85); }
.arrow:disabled { opacity: 0; pointer-events: none; }
.arrow--prev { left: clamp(0rem, 2vw, 1.5rem); }
.arrow--next { right: clamp(0rem, 2vw, 1.5rem); }

.dots { display: flex; gap: 0.25rem; margin-top: 1.25rem; }
.dots__btn { position: relative; width: 36px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; }
.dots__btn::before { content: ''; position: absolute; left: 6px; right: 6px; top: 50%; height: 3px; margin-top: -1.5px; background: rgba(255, 255, 255, 0.28); transition: background-color 0.3s var(--ease), left 0.3s var(--ease), right 0.3s var(--ease); }
.dots__btn[aria-current='true']::before { background: var(--red); left: 0; right: 0; }

/* ---------- 3. moto inteira ---------- */
.bike {
  --p: 0.5; position: relative; overflow: hidden; background: #000; color: #fff;
  padding-block: clamp(4rem, 10vw, 8rem) clamp(4rem, 9vw, 7rem);
}
@supports (overflow: clip) { .bike { overflow: clip; } }
.bike__word {
  position: absolute; left: 0; top: clamp(1rem, 4vw, 3rem); white-space: nowrap; pointer-events: none;
  font-family: var(--font-display); font-weight: 800; font-style: italic; text-transform: uppercase;
  font-size: clamp(7rem, 26vw, 24rem); line-height: 0.8; letter-spacing: -0.02em;
  color: rgba(227, 6, 19, 0.14);
  transform: translate3d(calc(8vw - var(--p) * 30vw), 0, 0);
}
/* foto 3:2 sem corte, no máximo na largura original (1200 px) para não perder nitidez */
.bike__media {
  position: relative; z-index: 1;
  width: min(calc(100% - 2 * var(--gutter)), 1200px); margin-inline: auto; aspect-ratio: 1200 / 800;
  border-radius: 4px; box-shadow: 0 40px 90px rgba(0, 0, 0, 0.7);
}
.bike__media img { transform: scale(1.04) translate3d(0, calc((0.5 - var(--p)) * 4%), 0); will-change: transform; }
.bike__media::after { content: ''; position: absolute; inset: auto 0 0 0; height: 4px; background: var(--red); }
.bike__text {
  position: relative; z-index: 1; display: grid; gap: 1.2rem; margin-top: clamp(2rem, 5vw, 3.5rem);
  opacity: clamp(0, calc((var(--p) - 0.3) * 6), 1);
  transform: translate3d(0, calc(clamp(0, (0.48 - var(--p)) * 200px, 40px)), 0);
}
.bike__rule { width: 3.5rem; height: 3px; background: var(--red); transform: skewX(var(--slant)); }
.bike__text .display { max-width: 18ch; }

/* ---------- celular e telas verticais ---------- */
@media (max-width: 760px), (max-aspect-ratio: 4/5) {
  .opening { height: 165vh; }
  /* no celular, a foto vira uma faixa larga no meio da tela, entre o texto e os botões */
  .opening__media, .opening__shade { top: 30%; bottom: auto; height: min(46%, 100vw * 1.02); width: 100%; }
  .opening__media img { transform: scale(calc(1.02 + var(--p) * 0.2)) translate3d(0, calc(var(--p) * -4%), 0); }
  .opening__shade {
    background:
      linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0) 16%, rgba(0, 0, 0, 0) 80%, #000 100%);
  }
  .opening__word { bottom: auto; top: 23%; font-size: 30vw; }
  .hero {
    left: max(var(--gutter), env(safe-area-inset-left, 0px)); right: max(var(--gutter), env(safe-area-inset-right, 0px)); width: auto;
    top: calc(var(--header-h) + env(safe-area-inset-top, 0px) + 0.75rem);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 4.4rem);
    display: flex; flex-direction: column;
    pointer-events: none;
  }
  .hero > * { pointer-events: auto; }
  .hero__logo { display: none; }
  .hero__title { font-size: clamp(2.6rem, 11.5vw, 4.2rem); }
  .hero__text { font-size: 1.0625rem; margin-top: 0.75rem; }
  .hero__actions { margin-top: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem 1.1rem; padding-inline: 0.4rem; }
  .hero__actions .btn { padding-inline: 0.5rem; font-size: 1rem; min-height: 3.1rem; }
  .hero__actions .btn .icon { display: none; }

  .details__inner { --h: min(52svh, 30rem); }
  .beat { font-size: clamp(2.2rem, 10vw, 3rem); }
  .arrow { display: none; }
  .card { width: min(90%, calc(var(--h) * var(--r))); }

  .bike__word { font-size: 34vw; }
}

/* ==========================================================================
   Versão parada: "Reduzir movimento" no iPhone (ou ?estatico).
   As fotos aparecem uma após a outra, sem seções fixas nem efeitos.
   ========================================================================== */
.static-stage .opening { height: auto; }
.static-stage .opening__sticky { position: relative; height: auto; min-height: 100vh; min-height: 100svh; }
.static-stage .opening, .static-stage .bike { --p: 0; }
.static-stage .hero { opacity: 1; transform: none; }
.static-stage .scroll-cue { opacity: 1; }
.static-stage .opening__media img, .static-stage .bike__media img { transform: none; }
.static-stage .opening__shade::after { opacity: 0; }
.static-stage .bike__text { opacity: 1; transform: none; }
.static-stage .arrow, .static-stage .dots { display: none; }
.static-stage .slides { flex-direction: column; gap: 2rem; overflow: visible; }
.static-stage .slide { height: auto; }
.static-stage .card { opacity: 1; transform: none; transition: none; }
