/* ==================================================
   Animals Carrousel — estilos propios de la plantilla
   (barra, botones, similares, CTA y WhatsApp vienen de themes/_kit/am-kit.css)
   ================================================== */

/* ---------- HERO: galería masonry en carrusel infinito ---------- */
.ac-hero {
	--band-fs: clamp(52px, 8.6vw, 150px);
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: 100svh;
	padding-top: 68px;
	background: #0a0a0a;
	color: #f5f5f0;
	overflow: hidden;
	perspective: 1600px;
}
/* En pantallas amplias el hero queda fijo y la sección siguiente se desliza por encima (telón) */
@media (min-width: 900px) and (min-height: 640px) {
	.ac-hero { position: sticky; top: 0; height: 100vh; height: 100svh; }
}
/* Oscurecido mientras el telón lo cubre (lo anima animals.js con --cover) */
.ac-hero::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 6;
	background: #0a0a0a;
	opacity: var(--cover, 0);
	pointer-events: none;
}
.ac-hero__grid {
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(to right, rgba(255, 224, 0, .07) 1px, transparent 1px),
		linear-gradient(to bottom, rgba(255, 224, 0, .07) 1px, transparent 1px);
	background-size: 64px 64px;
	pointer-events: none;
}

/* Título en franja infinita: reacciona a la velocidad de la galería */
.ac-page .ac-band {
	position: relative;
	z-index: 3;
	flex: 0 0 auto;   /* en pantallas bajas solo se achica la galería, nunca el título */
	margin: 0;
	padding: 8px 0 10px;
	overflow: hidden;
	font-family: var(--mb-display);
	font-weight: 900;
	font-size: var(--band-fs);
	line-height: .86;
	letter-spacing: -.05em;
	text-align: left;
	text-transform: uppercase;
	white-space: nowrap;
	color: var(--accent);
	border-bottom: 3px solid #26262f;
}
.ac-band__inner { display: inline-flex; will-change: transform; }
.ac-band__group { display: inline-flex; align-items: center; flex: 0 0 auto; }
.ac-band__group > span { padding: 0 .1em; }
.ac-band .is-out { color: transparent; -webkit-text-stroke: 2px var(--accent); }
.ac-band i { padding: 0 .3em; font-style: normal; font-size: .42em; color: #f5f5f0; }

/* Escenario 3D */
.ac-stage {
	position: relative;
	z-index: 2;
	flex: 1 1 auto;
	min-height: 300px;
	margin: clamp(12px, 1.8vw, 22px) 0;
	perspective: 1300px;
	outline: none;
	touch-action: pan-y;
	user-select: none;
	-webkit-user-select: none;
	transform-origin: 50% 0;
}
.ac-stage.is-enhanced { cursor: grab; }
.ac-stage.is-dragging { cursor: grabbing; }
.ac-stage:focus-visible { box-shadow: inset 0 0 0 3px var(--accent); }

/* Sin JS o con movimiento reducido: fila con scroll horizontal nativo */
.ac-track {
	position: absolute;
	inset: 0;
	display: flex;
	gap: 12px;
	padding: 0 var(--gutter);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	transform-style: preserve-3d;
}
.ac-track::-webkit-scrollbar { display: none; }
.ac-col {
	display: flex;
	flex: 0 0 auto;
	flex-direction: column;
	gap: 12px;
	height: 100%;
	scroll-snap-align: center;
}
.ac-col--tall { aspect-ratio: .78; }
.ac-col--stack { aspect-ratio: .58; }
/* Con JS: carrusel infinito, cada columna posicionada por transform */
.ac-track.is-loop { overflow: visible; padding: 0; scroll-snap-type: none; }
.ac-track.is-loop .ac-col { position: absolute; top: 0; left: 0; will-change: transform; backface-visibility: hidden; }

.ac-tile {
	position: relative;
	flex: 1 1 0;
	min-height: 0;
	margin: 0;
	overflow: hidden;
	background: #16161d;
	border: 3px solid #f5f5f0;
	transition: border-color .2s linear;
}
.ac-tile img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	pointer-events: none;
	-webkit-user-drag: none;
	transition: transform .8s var(--ease);
}
/* Capa pixelada: la imagen se "materializa" desde bloques grandes (animals.js) */
.ac-px {
	position: absolute;
	inset: 0;
	z-index: 1;
	width: 100%;
	height: 100%;
	image-rendering: pixelated;
	pointer-events: none;
	opacity: 0;
}
.ac-px.is-on { opacity: 1; }
.ac-tile.is-hidden img { visibility: hidden; }
/* Antes de la intro, las fotos esperan ocultas; si el JS fallara, aparecen solas a los 4 s */
@media (prefers-reduced-motion: no-preference) {
	.js .ac-hero:not(.is-ready) .ac-tile img { opacity: 0; animation: ac-show 0s 4s forwards; }
}
@keyframes ac-show { to { opacity: 1; } }

/* Pie de cada retrato: número siempre visible; nombre y frase aparecen con el cursor */
.ac-cap {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	padding: clamp(14px, 1.6vw, 24px);
	pointer-events: none;
}
.ac-cap::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(to top, rgba(10, 10, 10, .94) 0%, rgba(10, 10, 10, .45) 45%, rgba(10, 10, 10, 0) 72%);
	opacity: 0;
	transition: opacity .35s linear;
}
.ac-cap__n {
	position: absolute;
	top: 10px;
	left: 10px;
	padding: 3px 7px;
	font-family: var(--mb-mono);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .06em;
	background: #0a0a0a;
	color: var(--accent);
}
.ac-cap__name,
.ac-cap__quote { clip-path: inset(100% 0 0 0); transition: clip-path .55s cubic-bezier(.7, 0, .2, 1); }
.ac-cap__name {
	display: block;
	font-family: var(--mb-display);
	font-weight: 900;
	font-size: clamp(28px, 3.4vw, 60px);
	line-height: .9;
	letter-spacing: -.035em;
	text-transform: uppercase;
	color: #f5f5f0;
}
.ac-col--stack .ac-cap__name { font-size: clamp(22px, 2.1vw, 36px); }
.ac-cap__quote {
	display: block;
	max-width: 36ch;
	margin-top: 10px;
	font-family: var(--mb-mono);
	font-size: 12px;
	line-height: 1.5;
	color: rgba(245, 245, 240, .88);
	transition-delay: .07s;
}
.ac-col--stack .ac-cap__quote { font-size: 11px; }
.ac-tile:hover,
.ac-tile.is-active,
.ac-tile.is-open { border-color: var(--accent); }
.ac-tile:hover img,
.ac-tile.is-open img { transform: scale(1.08); }
.ac-tile:hover .ac-cap::before,
.ac-tile.is-active .ac-cap::before,
.ac-tile.is-open .ac-cap::before { opacity: 1; }
.ac-tile:hover .ac-cap__name,
.ac-tile:hover .ac-cap__quote,
.ac-tile.is-active .ac-cap__name,
.ac-tile.is-active .ac-cap__quote,
.ac-tile.is-open .ac-cap__name,
.ac-tile.is-open .ac-cap__quote { clip-path: inset(-10% 0 0 0); }

/* Cabina: el mono piloto y la velocidad */
.ac-hud {
	position: absolute;
	left: var(--gutter);
	bottom: 14px;
	z-index: 5;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 6px 14px 6px 6px;
	font-family: var(--mb-mono);
	font-size: 11px;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: #f5f5f0;
	background: #0a0a0a;
	border: 3px solid var(--accent);
	box-shadow: 5px 5px 0 var(--brand);
	pointer-events: none;
}
.ac-hud__monkey { width: 52px; height: 52px; background: var(--accent); image-rendering: pixelated; }
.ac-hud__data { display: flex; flex-direction: column; gap: 2px; line-height: 1.35; }
.ac-hud__pilot { font-weight: 700; color: var(--accent); }
.ac-speed { display: inline-block; min-width: 3.6ch; font-variant-numeric: tabular-nums; color: var(--accent); }
.ac-hud__hint { opacity: .7; }

/* Pie del hero */
.ac-hero__foot {
	position: relative;
	z-index: 3;
	flex: 0 0 auto;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto auto;
	gap: 16px clamp(20px, 3vw, 48px);
	align-items: center;
	/* a la derecha queda libre el lugar del botón flotante de WhatsApp */
	padding: 0 calc(var(--gutter) + 140px) clamp(16px, 2.4vw, 28px) var(--gutter);
}
.ac-meta {
	margin: 0 0 6px;
	font-family: var(--mb-mono);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--accent);
}
.ac-lead { max-width: 58ch; margin: 0; font-size: clamp(15px, 1.15vw, 18px); line-height: 1.5; color: rgba(245, 245, 240, .86); }
.ac-ctrl { display: flex; align-items: center; gap: 10px; }
.ac-count { margin: 0 8px 0 0; font-family: var(--mb-mono); font-size: 14px; color: rgba(245, 245, 240, .7); white-space: nowrap; }
.ac-idx {
	display: inline-block;
	min-width: 1.3em;
	font-family: var(--mb-display);
	font-weight: 900;
	font-size: 36px;
	line-height: 1;
	letter-spacing: -.02em;
	vertical-align: -5px;
	color: var(--accent);
}
@media (max-width: 1180px) {
	.ac-hero__foot { grid-template-columns: minmax(0, 1fr) auto; }
	.ac-hero__foot .ak-actions { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
	.ac-hero { padding-top: 60px; }
	.ac-stage { flex: 0 0 auto; height: 54vh; height: 54svh; min-height: 280px; }
	.ac-hud { display: none; }
	.ac-hero__foot { grid-template-columns: 1fr; padding: 0 var(--gutter) 88px; }
	.ac-ctrl { order: -1; }
	.ac-hero__foot .ak-actions .ak-btn { flex: 1 1 auto; }
	.ac-cap__quote { display: none; }
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
	.ac-tile img,
	.ac-cap__name,
	.ac-cap__quote { transition: none; }
}
