/* MC FX — intro + particles + cinematic 3D tire stage */

#mc-fx-intro {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: end center;
  padding-bottom: clamp(1.5rem, 8vh, 4.5rem);
  background: #030507;
  transition: opacity 0.75s ease, transform 0.75s ease;
}

#mc-fx-intro.mc-fx-intro-out {
  opacity: 0;
  transform: scale(1.06);
  pointer-events: none;
}

#mc-fx-intro.mc-fx-intro-impact .mc-fx-intro-inner {
  animation: mcIntroKick 0.45s ease-out;
}

@keyframes mcIntroKick {
  0% {
    transform: translateY(0) scale(1);
  }
  35% {
    transform: translateY(6px) scale(1.03);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

.mc-fx-intro-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.mc-fx-intro-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(3, 5, 7, 0.15) 0%,
    transparent 35%,
    rgba(3, 5, 7, 0.55) 78%,
    rgba(3, 5, 7, 0.92) 100%
  );
  z-index: 1;
}

.mc-fx-intro-inner {
  position: relative;
  z-index: 2;
  width: min(520px, 92vw);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  opacity: 0;
  transform: translateY(28px) scale(0.96);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.mc-fx-intro-inner.mc-fx-intro-show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.mc-fx-intro-inner.mc-fx-intro-boom .mc-fx-intro-logo {
  filter: drop-shadow(0 0 42px rgba(230, 57, 70, 0.85));
}

.mc-fx-intro-eyebrow {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.mc-fx-intro-logo {
  width: min(380px, 78vw);
  height: auto;
  filter: drop-shadow(0 0 28px rgba(230, 57, 70, 0.45));
  animation: mcLogoPulse 2.2s ease-in-out infinite;
}

@keyframes mcLogoPulse {
  0%,
  100% {
    transform: translateY(0);
    filter: drop-shadow(0 0 18px rgba(230, 57, 70, 0.3));
  }
  50% {
    transform: translateY(-8px);
    filter: drop-shadow(0 0 36px rgba(230, 57, 70, 0.65));
  }
}

.mc-fx-intro-title {
  margin: 0;
  font-family: "Racing Sans One", Inter, sans-serif;
  font-size: clamp(1.7rem, 5.5vw, 2.7rem);
  letter-spacing: 0.08em;
  color: #fff;
  text-shadow: 0 12px 40px rgba(0, 0, 0, 0.65);
}

.mc-fx-intro-tag {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.72);
}

.mc-fx-intro-step {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #e63946;
}

.mc-fx-bar {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  margin-top: 0.15rem;
}

.mc-fx-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #e63946, #ff7a7f, #e63946);
  background-size: 200% 100%;
  animation: mcBarShine 1.2s linear infinite;
  box-shadow: 0 0 16px rgba(230, 57, 70, 0.7);
}

@keyframes mcBarShine {
  0% {
    background-position: 0% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.mc-fx-km {
  color: #fff;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
}

.mc-fx-km small {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-left: 0.2rem;
}

.mc-fx-skip {
  margin-top: 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.mc-fx-skip:hover {
  border-color: #e63946;
  background: rgba(230, 57, 70, 0.15);
  color: #fff;
}

#mc-fx-particles {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9990;
}

html.mc-intro-active,
body.mc-intro-active {
  overflow: hidden;
}

/* ---- 3D tire stage (Three.js) ---- */

.tire-scroll {
  --tire-p: 0;
  position: relative;
  height: 270vh;
  background: #0a1520;
}

.tire-scroll-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.tire-scroll-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      rgba(8, 16, 24, 0.22) 0%,
      rgba(8, 16, 24, 0.08) 42%,
      rgba(3, 5, 7, 0.5) 100%
    ),
    radial-gradient(
      ellipse 70% 55% at 50% 40%,
      rgba(230, 57, 70, calc(0.05 + var(--tire-p) * 0.16)),
      transparent 60%
    ),
    url("../img/tire-studio-bg.png") center 42% / cover no-repeat,
    linear-gradient(180deg, #2a4a5c 0%, #0e1a24 55%, #060a10 100%);
  transform: scale(calc(1 + var(--tire-p) * 0.03));
}

.tire-scroll-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 75% 65% at 50% 42%,
    transparent 42%,
    rgba(3, 8, 14, 0.32) 100%
  );
  pointer-events: none;
}

.tire-scroll-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    rgba(255, 255, 255, 0.03) 0.6px,
    transparent 0.6px
  );
  background-size: 2.5px 2.5px;
  opacity: 0.16;
  mask-image: radial-gradient(ellipse at 50% 40%, #000 18%, transparent 68%);
  pointer-events: none;
}

.tire-scroll-center {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  padding: calc(var(--nav-height, 72px) + var(--topbar-height, 38px) + 0.6rem)
    1rem calc(1.15rem + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
}

.tire-scroll-top {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 34rem;
  padding: 0 0.5rem;
}

.tire-scroll-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.tire-scroll-lead {
  margin: 0;
  font-family: var(--font-display, "Racing Sans One", sans-serif);
  font-size: clamp(1.35rem, 3.6vw, 2.15rem);
  line-height: 1.15;
  color: #fff;
  text-shadow: 0 10px 36px rgba(0, 0, 0, 0.55);
}

/* Full-bleed WebGL — sin caja rectangular visible */
.tire-3d-mount {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.tire-3d-mount canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  outline: none;
  /* Disuelve bordes del canvas en el fondo de la página */
  -webkit-mask-image: radial-gradient(
    ellipse 78% 72% at 50% 42%,
    #000 38%,
    rgba(0, 0, 0, 0.85) 58%,
    transparent 78%
  );
  mask-image: radial-gradient(
    ellipse 78% 72% at 50% 42%,
    #000 38%,
    rgba(0, 0, 0, 0.85) 58%,
    transparent 78%
  );
}

.tire-scroll-copy {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 560px;
  margin-bottom: 0.4vh;
  pointer-events: none;
}

.tire-scroll-title {
  font-family: var(--font-display, "Racing Sans One", sans-serif);
  font-size: clamp(1.9rem, 5vw, 3.2rem);
  color: #fff;
  line-height: 1.05;
  margin: 0.35rem 0 0;
  text-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
}

@media (max-width: 700px) {
  .tire-scroll {
    height: 210vh;
  }

  .tire-scroll-center {
    justify-content: space-between;
    padding-top: calc(var(--nav-height, 64px) + var(--topbar-height, 34px) + 0.35rem);
    padding-bottom: calc(0.85rem + env(safe-area-inset-bottom, 0px));
  }

  .tire-3d-mount {
    /* Deja aire arriba/abajo: el canvas no “come” toda la pantalla */
    top: 10%;
    bottom: 18%;
    height: auto;
  }

  .tire-scroll-top {
    max-width: 92vw;
  }

  .tire-scroll-lead {
    font-size: clamp(1.15rem, 5.5vw, 1.55rem);
  }

  .tire-scroll-copy {
    margin-bottom: 0.5vh;
    max-width: 92vw;
    padding: 0 0.35rem;
  }

  .tire-scroll-title {
    font-size: clamp(1.45rem, 7vw, 2rem);
    margin: 0.2rem 0 0;
  }

  .tire-3d-mount canvas {
    -webkit-mask-image: radial-gradient(
      ellipse 78% 72% at 50% 46%,
      #000 28%,
      rgba(0, 0, 0, 0.85) 52%,
      transparent 74%
    );
    mask-image: radial-gradient(
      ellipse 78% 72% at 50% 46%,
      #000 28%,
      rgba(0, 0, 0, 0.85) 52%,
      transparent 74%
    );
  }
}

@media (max-width: 400px) {
  .tire-3d-mount {
    top: 8%;
    bottom: 26%;
  }

  .tire-scroll {
    height: 195vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mc-fx-intro-logo {
    animation: none;
  }
}
