/* ==========================================================
   Afro Friends Records · capa de movimiento (motion.css)
   Solo animaciones: no cambia colores, textos ni estructura.
   Todo lo que oculta contenido vive bajo html.m, que solo se
   activa con JS y sin "reducir movimiento" en el sistema.
   ========================================================== */
:root {
  --m-ease: cubic-bezier(.16, 1, .3, 1);
  --m-io: cubic-bezier(.65, 0, .35, 1);
  --m-spring: cubic-bezier(.34, 1.56, .64, 1);
}

/* ---------- Cabecera fija que se esconde al bajar ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 40;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: transform .55s var(--m-ease), box-shadow .4s ease;
}
header.m-scrolled { box-shadow: 0 10px 30px #0007; }
header.m-hide { transform: translate3d(0, -101%, 0); }

/* Barra de scroll de los carruseles: fina, oscura, con el rojo de la marca */
#rack, .catalog-rail { scrollbar-width: thin; scrollbar-color: #ff503c99 #ffffff0d; overflow-y: hidden; }
#rack { padding-top: 12px; margin-top: -12px; }
#rack::-webkit-scrollbar, .catalog-rail::-webkit-scrollbar { height: 4px; }
#rack::-webkit-scrollbar-track, .catalog-rail::-webkit-scrollbar-track { background: #ffffff0d; border-radius: 4px; }
#rack::-webkit-scrollbar-thumb, .catalog-rail::-webkit-scrollbar-thumb { background: #ff503c99; border-radius: 4px; }
#rack::-webkit-scrollbar-thumb:hover, .catalog-rail::-webkit-scrollbar-thumb:hover { background: #ff503c; }
#rack::-webkit-scrollbar-button, .catalog-rail::-webkit-scrollbar-button { display: none; }

/* Línea de nombre en el menú */
nav a { position: relative; }
nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -5px;
  height: 1px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .45s var(--m-ease);
}
nav a:hover::after, nav a.is-active::after { transform: scaleX(1); transform-origin: left; }
nav a.is-active { color: #ff9a8a; }

/* Barra de progreso de lectura */
.m-progress {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 2px;
  z-index: 60;
  pointer-events: none;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, #ff503c, #ff8f73 60%, #ffd2c2);
  box-shadow: 0 0 10px #ff503c99;
}

/* Partículas de fondo (canvas) */
.m-particles {
  position: fixed;
  inset: 0;
  width: 100%; height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* ---------- Hero: títulos del vinilo ---------- */
h1 .ln, h1 .ln > span { color: inherit; }
h1 .ln .dot { color: var(--red); }
h1 .ln {
  display: block;
  overflow: hidden;
  padding: .06em 0 .08em;
  margin: -.06em 0 -.08em;
  white-space: nowrap;
}
h1 .ln > span, h1 .dot { display: inline-block; }

.hero { position: relative; }
.stage .disc { will-change: transform; }

/* Ecualizador al pie del hero (lo crea motion.js) */
.m-eq {
  position: absolute;
  left: 6%; right: 6%;
  bottom: 22px;
  height: 30px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  pointer-events: none;
  opacity: .42;
  --amp: 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.m-eq span {
  flex: 0 0 2px;
  height: 100%;
  background: linear-gradient(#ff6a52, #ff503c22);
  transform-origin: 50% 100%;
  transform: scaleY(calc(var(--h) * (1 + var(--amp))));
  animation: m-beat .484s cubic-bezier(.2, .8, .3, 1) infinite;
  animation-delay: var(--dl);
  border-radius: 1px 1px 0 0;
}
@keyframes m-beat {
  0% { scale: 1 1; }
  12% { scale: 1 1.9; }
  100% { scale: 1 .55; }
}

/* ---------- Botones ---------- */
.cta, .af-main { position: relative; overflow: hidden; isolation: isolate; }
.cta::after, #reacciones .af-main::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(105deg, transparent 30%, #fff8 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform .8s var(--m-ease);
}
.cta:hover::after, #reacciones .af-main:hover::after { transform: translateX(120%); }
.cta, .af-main, header .outline, .links > *, .duo button, .shop-actions > * {
  translate: var(--mx, 0) var(--my, 0);
  transition: translate .45s var(--m-ease), background-color .3s ease, border-color .3s ease, color .3s ease;
}
button:active, .cta:active, .outline:active { scale: .97; }

/* ---------- Tarjetas y fotos ---------- */
.card img { transition: transform .6s var(--m-ease), box-shadow .6s var(--m-ease); }
.card strong { transition: color .3s ease; }
@media (hover: hover) and (pointer: fine) {
  .card:hover img { transform: translateY(-8px) rotate(-1.2deg); box-shadow: 0 18px 30px #000a, 0 0 0 1px #ff503c66; }
  .card:hover strong { color: #ff9a8a; }
  .duo article { position: relative; transition: transform .6s var(--m-ease), background-color .4s ease; }
  .duo article::before {
    content: "";
    position: absolute;
    left: 0; top: 0; right: 0;
    height: 2px;
    background: var(--red);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .6s var(--m-ease);
  }
  .duo article:hover { transform: translateY(-6px); background-color: #262622; }
  .duo article:hover::before { transform: scaleX(1); }
  .merch-photo { transition: transform .55s var(--m-ease), border-color .3s ease, box-shadow .55s var(--m-ease); }
  .merch-photo:hover { transform: translateY(-5px); box-shadow: 0 16px 28px #0009; }
  .contact-channels a span { transition: transform .45s var(--m-ease), color .3s ease; display: inline-block; }
  .contact-channels a:hover span { transform: translateX(6px); color: #fff; }
  footer a:hover { color: #ff9a8a; }
}

/* LIVE de TikTok: punto rojo que titila */
#reacciones .af-tiktok b::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: 5px;
  vertical-align: 1px;
  border-radius: 50%;
  background: #ff3b30;
}

/* Ventanas (formularios y visor de la tienda) */
dialog[open] { animation: m-dialog .5s var(--m-ease); }
dialog[open]::backdrop { animation: m-fade .4s ease; }
@keyframes m-dialog { from { opacity: 0; transform: translateY(24px) scale(.97); } }
@keyframes m-fade { from { opacity: 0; } }
#visor-foto { animation: m-fade .45s ease; }

/* Parallax de la foto de Uriel */
#reacciones .af-face { scale: 1.12; translate: 0 var(--py, 0px); }

/* Secciones: línea inferior que se dibuja */
main > section { position: relative; }

/* ==========================================================
   Todo lo de abajo solo corre con movimiento activado (html.m)
   ========================================================== */

/* Entrada del hero */
.m header { animation: m-drop .9s var(--m-ease) backwards; }
.m .intro small { animation: m-up .9s var(--m-ease) .15s backwards; }
.m .intro .ln > span { animation: m-rise 1.15s var(--m-ease) backwards; }
.m .intro .ln:nth-child(1) > span { animation-delay: .25s; }
.m .intro .ln:nth-child(2) > span { animation-delay: .4s; }
.m .intro h1 .dot { animation: m-pop .8s var(--m-spring) 1.15s backwards; }
.m .intro p { animation: m-up 1s var(--m-ease) .65s backwards; }
.m .intro .cta { animation: m-up 1s var(--m-ease) .8s backwards; }
.m .hero .stage { animation: m-wipe 1.3s var(--m-io) .2s backwards; }
.m .hero .sticker { animation: m-sticker .9s var(--m-spring) 1.35s backwards, m-float 7s ease-in-out 2.4s infinite; }
.m .hero .legend { animation: m-fade 1s ease 1.5s backwards; }
.m .m-eq { animation: m-fade 1.4s ease 1.2s backwards; }
.m .intro small i { animation: m-ping 2.2s ease-out 1.6s infinite; }
.m .hero .cta b { display: inline-block; animation: m-bob 1.9s ease-in-out 2s infinite; }
.m #reacciones .af-tiktok b::before { animation: m-blink 1.1s steps(2, jump-none) infinite; }
.m .hero { padding-bottom: 86px; }

@keyframes m-drop { from { transform: translate3d(0, -100%, 0); opacity: 0; } }
@keyframes m-up { from { transform: translate3d(0, 26px, 0); opacity: 0; } }
@keyframes m-rise { from { transform: translate3d(0, 110%, 0) rotate(3deg); } }
@keyframes m-pop { from { transform: scale(0); } }
@keyframes m-wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes m-sticker { from { transform: rotate(-40deg) scale(.3); opacity: 0; } to { transform: rotate(-7deg); } }
@keyframes m-float { 0%, 100% { transform: rotate(-7deg) translateY(0); } 50% { transform: rotate(-4deg) translateY(-6px); } }
@keyframes m-ping { 0% { box-shadow: 0 0 0 0 #ff503caa; } 70%, 100% { box-shadow: 0 0 0 9px #ff503c00; } }
@keyframes m-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
@keyframes m-blink { 50% { opacity: .15; } }

/* Revelados al hacer scroll (motion.js marca cada elemento con data-m) */
.m [data-m] { transition-delay: var(--d, 0ms); }
.m [data-m="up"] {
  opacity: 0;
  transform: translate3d(0, 34px, 0);
  transition-property: opacity, transform;
  transition-duration: .95s, 1.1s;
  transition-timing-function: ease, var(--m-ease);
}
.m [data-m="up"].in { opacity: 1; transform: none; }

.m [data-m="label"] {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1s var(--m-io);
}
.m [data-m="label"].in { clip-path: inset(0 0 0 0); }

h2 .mk, h2 .mi { color: inherit; }
h2 .mk { display: block; overflow: hidden; padding: .06em 0 .1em; margin: -.06em 0 -.1em; }
h2 .mi, h2 .m-dot { display: inline-block; }
.m [data-m="mask"] .mi { transform: translate3d(0, 112%, 0) rotate(2deg); transition: transform 1.15s var(--m-ease) var(--d, 0ms); }
.m [data-m="mask"].in .mi { transform: none; }
.m [data-m="mask"] .m-dot { transform: scale(0); transition: transform .7s var(--m-spring) calc(var(--d, 0ms) + .6s); }
.m [data-m="mask"].in .m-dot { transform: none; }

.m [data-m="img"] {
  clip-path: inset(100% 0 0 0);
  transition: clip-path 1.25s var(--m-io);
}
.m [data-m="img"] img:not(.af-face) { transform: scale(1.2); transition: transform 1.7s var(--m-ease) var(--d, 0ms); }
.m [data-m="img"].in { clip-path: inset(0 0 0 0); }
.m [data-m="img"].in img:not(.af-face) { transform: none; }

/* Líneas que se dibujan: borde de cada sección, servicios y contacto */
.m main > section:not(.hero) { border-bottom-color: transparent; }
.m main > section::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, #ff503c, #ff503c55 18%, #343431 45%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.8s var(--m-io) .2s;
}
.m main > section.hero { border-bottom-color: transparent; }
.m main > section.m-seen::after { transform: scaleX(1); }
.m .services hr { transform: scaleX(0); transform-origin: left; transition: transform 1.2s var(--m-io); }
.m .services hr:nth-of-type(2) { transition-delay: .25s; }
.m .m-seen .services hr { transform: none; }
.m .contact-channels a { position: relative; border-top-color: transparent; }
.m .contact-channels a::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: -1px;
  height: 1px;
  background: linear-gradient(90deg, #ff503c, #54524d 40%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.3s var(--m-io) calc(var(--d, 0ms) + .2s);
}
.m .contact-channels a.in::before { transform: none; }
.m .contact-channels a.m-done::before { transform: none; transition: none; }

/* ---------- Páginas de artista ---------- */
.m .artist-profile > img { animation: m-wipe-up 1.3s var(--m-io) .15s backwards; }
.m .artist-profile > div > * { animation: m-up 1s var(--m-ease) backwards; }
.m .artist-profile > div > :nth-child(1) { animation-delay: .3s; }
.m .artist-profile > div > :nth-child(2) { animation-delay: .42s; }
.m .artist-profile > div > :nth-child(3) { animation-delay: .56s; }
.m .artist-profile > div > :nth-child(4) { animation-delay: .7s; }
@keyframes m-wipe-up { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }

/* ---------- Teléfonos ---------- */
@media (max-width: 760px) {
  .m-eq { left: 5%; right: 5%; bottom: 16px; height: 22px; }
  .m .hero { padding-bottom: 60px; }
  .m [data-m="up"] { transform: translate3d(0, 22px, 0); }
}

/* ---------- Reducir movimiento: todo quieto y visible ---------- */
@media (prefers-reduced-motion: reduce) {
  header { transition: none; }
  header.m-hide { transform: none; }
  .m-eq span, .m-particles { display: none; }
  dialog[open], dialog[open]::backdrop, #visor-foto { animation: none; }
  #reacciones .af-face { scale: 1; translate: none; }
}
